Oihana PHP Arango

log.php

Table of Contents

Functions

log()  : string
Return the natural logarithm of a value.

Functions

log()

Return the natural logarithm of a value.

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

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

Example AQL usage:

LOG(1)                 // returns 0
LOG(2.718281828459045) // returns 1 (ln(e) = 1)
LOG(10)                // returns 2.302585092994046
LOG(0)                 // returns null (invalid input)
LOG(-1)                // 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\log;

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

For the base-2 logarithm.

log10()

For the base-10 logarithm.

exp()

For the exponential function (inverse of LOG).

since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results