Oihana PHP Arango

pow.php

Table of Contents

Functions

pow()  : string
Return the base raised to the power of the exponent.

Functions

pow()

Return the base raised to the power of the exponent.

pow(mixed $base, int $exp) : string

This helper wraps the ArangoDB AQL function POW(base, exp) which returns the base raised to the power of the exponent. This is equivalent to base^exp.

Example AQL usage:

POW(2, 3)  // returns 8 (2³)
POW(10, 2) // returns 100 (10²)
POW(5, 0)  // returns 1 (any number to power 0)
POW(2, -1) // returns 0.5 (2⁻¹)
Parameters
$base : mixed

The base value.

$exp : int

The exponent value.

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

$expr = pow(2, 3);
// Produces: 'POW(2, 3)'
see
https://docs.arangodb.com/stable/aql/functions/numeric/#pow
sqrt()

For the square root (POW(x, 0.5)).

since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results