Oihana PHP Arango

exp2.php

Table of Contents

Functions

exp2()  : string
Return 2 raised to the power of a value.

Functions

exp2()

Return 2 raised to the power of a value.

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

This helper wraps the ArangoDB AQL function EXP2(value) which returns 2 raised to the power of the given value. This is useful for binary operations and exponential growth calculations.

Example AQL usage:

EXP2(0)                       // returns 1
EXP2(1)                       // returns 2
EXP2(2)                       // returns 4
EXP2(3)                       // returns 8
EXP2(-1)                      // returns 0.5
Parameters
$value : string|int|float

The exponent value.

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

$expr = exp2(3);
// Produces: 'EXP2(3)'
see
https://docs.arangodb.com/stable/aql/functions/numeric/#exp2
exp()

For Euler's constant raised to a power.

log2()

For the base-2 logarithm (inverse of EXP2).

since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results