Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "math/base/special/log2/docs/types/index.d"

Index

Functions

Functions

log2

  • log2(x: number): number
  • Evaluates the binary logarithm (base two).

    Notes

    • For negative numbers, the binary logarithm is not defined.

    Parameters

    • x: number

      input value

    Returns number

    function value

    Example

    var v = log2( 4.0 );
    // returns 2.0

    Example

    var v = log2( 8.0 );
    // returns 3.0

    Example

    var v = log2( 0.0 );
    // returns -Infinity

    Example

    var v = log2( Infinity );
    // returns Infinity

    Example

    var v = log2( NaN );
    // returns NaN

    Example

    var v = log2( -4.0 );
    // returns NaN