HH\Lib\Math\log

Meta Engineer?

This is available as Math\log in the www repository.

Returns the logarithm base $base of $arg

namespace HH\Lib\Math;

function log(
  num $arg,
  ?num $base = NULL,
): float;

For the exponential function, see Math\exp().

Parameters

  • num $arg
  • ?num $base = NULL

Returns

  • float

Examples

$x = 10;
$log = Math\log($x);
echo "Log is $log \n"; // Output: Log is 2.302585092994