Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Index

Functions

Functions

Export assignment trunc2

  • trunc2(x: number): number
  • Rounds a numeric value to the nearest power of two toward zero.

    Parameters

    • x: number

      input value

    Returns number

    rounded value

    Example

    var v = trunc2( 3.141592653589793 );
    // returns 2.0

    Example

    var v = trunc2( 13.0 );
    // returns 8.0

    Example

    var v = trunc2( -0.314 );
    // returns -0.25