Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 400 and 401]

(no description)

File Size: 102 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Logarithms:: (3 methods):
  withBase()
  base10()
  natural()


Class: Logarithms  - X-Ref

withBase($number, $base = 10)   X-Ref
LOG_BASE.

Returns the logarithm of a number to a specified base. The default base is 10.

Excel Function:
LOG(number[,base])

param: mixed $number The positive real number for which you want the logarithm
param: mixed $base The base of the logarithm. If base is omitted, it is assumed to be 10.
return: array|float|string The result, or a string containing an error

base10($number)   X-Ref
LOG10.

Returns the result of builtin function log after validating args.

param: mixed $number Should be numeric
return: array|float|string Rounded number

natural($number)   X-Ref
LN.

Returns the result of builtin function log after validating args.

param: mixed $number Should be numeric
return: array|float|string Rounded number