Oihana PHP Arango

sqrt.php

Table of Contents

Functions

sqrt()  : string
Return the square root of a value.

Functions

sqrt()

Return the square root of a value.

sqrt(string|int|float $value) : string

This helper wraps the ArangoDB AQL function SQRT(value) which returns the square root of a value. The value must be non-negative, otherwise it returns null.

Example AQL usage:

SQRT(0)  // returns 0
SQRT(1)  // returns 1
SQRT(4)  // returns 2
SQRT(9)  // returns 3
SQRT(-1) // returns null (invalid input)
Parameters
$value : string|int|float

The input value (must be non-negative).

Tags
example
use function oihana\arango\db\functions\numerics\sqrt;

$expr = sqrt(16);
// Produces: 'SQRT(16)'
see
https://docs.arangodb.com/stable/aql/functions/numeric/#sqrt
pow()

For raising to a power (SQRT(x) = POW(x, 0.5)).

since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results