Oihana PHP Arango

log2.php

Table of Contents

Functions

log2()  : string
Return the base-2 logarithm of a value.

Functions

log2()

Return the base-2 logarithm of a value.

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

This helper wraps the ArangoDB AQL function LOG2(value) which returns the base-2 logarithm of a value. The value must be greater than 0, otherwise it returns null.

Example AQL usage:

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

The input value (must be greater than 0).

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

$expr = log2(8);
// Produces: 'LOG2(8)'
see
https://docs.arangodb.com/stable/aql/functions/numeric/#log2
log()

For the natural logarithm.

log10()

For the base-10 logarithm.

exp2()

For 2 raised to a power (inverse of LOG2).

since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results