Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "int/int"

Index

Variables

MAX_SAFE_INTEGER

MAX_SAFE_INTEGER: 9007199254740991 = 9007199254740991

Math.pow(2, 53) - 1

In ES2015 Number.MAX_SAFE_INTEGER.

isInteger

isInteger: isInteger = (Number as { isInteger?(n: number): boolean }).isInteger || isIntegerShim

Returns true if the argument is an integer number.

In ES2015, Number.isInteger.

mul

mul: imul = (Math as { imul?(a: number, b: number): number }).imul || imulShim

32-bit integer multiplication.

Functions

add

  • add(a: number, b: number): number
  • 32-bit integer addition.

    Parameters

    • a: number
    • b: number

    Returns number

isSafeInteger

  • isSafeInteger(n: number): boolean
  • Returns true if the argument is a safe integer number (-MIN_SAFE_INTEGER < number <= MAX_SAFE_INTEGER)

    In ES2015, Number.isSafeInteger.

    Parameters

    • n: number

    Returns boolean

rotl

  • rotl(x: number, n: number): number
  • 32-bit integer left rotation

    Parameters

    • x: number
    • n: number

    Returns number

rotr

  • rotr(x: number, n: number): number
  • 32-bit integer left rotation

    Parameters

    • x: number
    • n: number

    Returns number

sub

  • sub(a: number, b: number): number
  • 32-bit integer subtraction.

    Parameters

    • a: number
    • b: number

    Returns number

Generated using TypeDoc