Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface BigInteger

Hierarchy

  • BigInteger

Index

Methods

abs

  • Returns the absolute value of a bigInt.

    Returns BigInteger

add

and

  • Performs the bitwise AND operation.

    Parameters

    • number: number

    Returns BigInteger

  • Performs the bitwise AND operation.

    Parameters

    Returns BigInteger

  • Performs the bitwise AND operation.

    Parameters

    • number: string

    Returns BigInteger

compare

  • compare(number: number): number
  • compare(number: BigInteger): number
  • compare(number: string): number
  • Performs a comparison between two numbers. If the numbers are equal, it returns 0. If the first number is greater, it returns 1. If the first number is lesser, it returns -1.

    Parameters

    • number: number

    Returns number

  • Performs a comparison between two numbers. If the numbers are equal, it returns 0. If the first number is greater, it returns 1. If the first number is lesser, it returns -1.

    Parameters

    Returns number

  • Performs a comparison between two numbers. If the numbers are equal, it returns 0. If the first number is greater, it returns 1. If the first number is lesser, it returns -1.

    Parameters

    • number: string

    Returns number

compareAbs

  • compareAbs(number: number): number
  • compareAbs(number: BigInteger): number
  • compareAbs(number: string): number
  • Performs a comparison between the absolute value of two numbers.

    Parameters

    • number: number

    Returns number

  • Performs a comparison between the absolute value of two numbers.

    Parameters

    Returns number

  • Performs a comparison between the absolute value of two numbers.

    Parameters

    • number: string

    Returns number

divide

  • Performs integer division, disregarding the remainder.

    Parameters

    • number: number

    Returns BigInteger

  • Performs integer division, disregarding the remainder.

    Parameters

    Returns BigInteger

  • Performs integer division, disregarding the remainder.

    Parameters

    • number: string

    Returns BigInteger

divmod

  • divmod(number: number): object
  • divmod(number: BigInteger): object
  • divmod(number: string): object
  • Performs division and returns an object with two properties: quotient and remainder. The sign of the remainder will match the sign of the dividend.

    Parameters

    • number: number

    Returns object

  • Performs division and returns an object with two properties: quotient and remainder. The sign of the remainder will match the sign of the dividend.

    Parameters

    Returns object

  • Performs division and returns an object with two properties: quotient and remainder. The sign of the remainder will match the sign of the dividend.

    Parameters

    • number: string

    Returns object

equals

  • equals(number: number): boolean
  • equals(number: BigInteger): boolean
  • equals(number: string): boolean
  • Checks if two numbers are equal.

    Parameters

    • number: number

    Returns boolean

  • Checks if two numbers are equal.

    Parameters

    Returns boolean

  • Checks if two numbers are equal.

    Parameters

    • number: string

    Returns boolean

greater

  • greater(number: number): boolean
  • greater(number: BigInteger): boolean
  • greater(number: string): boolean
  • Checks if the first number is greater than the second.

    Parameters

    • number: number

    Returns boolean

  • Checks if the first number is greater than the second.

    Parameters

    Returns boolean

  • Checks if the first number is greater than the second.

    Parameters

    • number: string

    Returns boolean

greaterOrEquals

  • greaterOrEquals(number: number): boolean
  • greaterOrEquals(number: BigInteger): boolean
  • greaterOrEquals(number: string): boolean
  • Checks if the first number is greater than or equal to the second.

    Parameters

    • number: number

    Returns boolean

  • Checks if the first number is greater than or equal to the second.

    Parameters

    Returns boolean

  • Checks if the first number is greater than or equal to the second.

    Parameters

    • number: string

    Returns boolean

isEven

  • isEven(): boolean
  • Returns true if the number is even, false otherwise.

    Returns boolean

isNegative

  • isNegative(): boolean
  • Returns true if the number is negative, false otherwise. Returns false for 0 and true for -0.

    Returns boolean

isOdd

  • isOdd(): boolean
  • Returns true if the number is odd, false otherwise.

    Returns boolean

isPositive

  • isPositive(): boolean
  • Return true if the number is positive, false otherwise. Returns true for 0 and false for -0.

    Returns boolean

lesser

  • lesser(number: number): boolean
  • lesser(number: BigInteger): boolean
  • lesser(number: string): boolean
  • Checks if the first number is lesser than the second.

    Parameters

    • number: number

    Returns boolean

  • Checks if the first number is lesser than the second.

    Parameters

    Returns boolean

  • Checks if the first number is lesser than the second.

    Parameters

    • number: string

    Returns boolean

lesserOrEquals

  • lesserOrEquals(number: number): boolean
  • lesserOrEquals(number: BigInteger): boolean
  • lesserOrEquals(number: string): boolean
  • Checks if the first number is less than or equal to the second.

    Parameters

    • number: number

    Returns boolean

  • Checks if the first number is less than or equal to the second.

    Parameters

    Returns boolean

  • Checks if the first number is less than or equal to the second.

    Parameters

    • number: string

    Returns boolean

minus

  • Alias for the subtract method.

    Parameters

    • number: number

    Returns BigInteger

  • Alias for the subtract method.

    Parameters

    Returns BigInteger

  • Alias for the subtract method.

    Parameters

    • number: string

    Returns BigInteger

mod

  • Performs division and returns the remainder, disregarding the quotient. The sign of the remainder will match the sign of the dividend.

    Parameters

    • number: number

    Returns BigInteger

  • Performs division and returns the remainder, disregarding the quotient. The sign of the remainder will match the sign of the dividend.

    Parameters

    Returns BigInteger

  • Performs division and returns the remainder, disregarding the quotient. The sign of the remainder will match the sign of the dividend.

    Parameters

    • number: string

    Returns BigInteger

multiply

  • Performs multiplication.

    Parameters

    • number: number

    Returns BigInteger

  • Performs multiplication.

    Parameters

    Returns BigInteger

  • Performs multiplication.

    Parameters

    • number: string

    Returns BigInteger

next

not

  • Performs the bitwise NOT operation.

    Returns BigInteger

notEquals

  • notEquals(number: number): boolean
  • notEquals(number: BigInteger): boolean
  • notEquals(number: string): boolean
  • Checks if two numbers are not equal.

    Parameters

    • number: number

    Returns boolean

  • Checks if two numbers are not equal.

    Parameters

    Returns boolean

  • Checks if two numbers are not equal.

    Parameters

    • number: string

    Returns boolean

or

  • Performs the bitwise OR operation.

    Parameters

    • number: number

    Returns BigInteger

  • Performs the bitwise OR operation.

    Parameters

    Returns BigInteger

  • Performs the bitwise OR operation.

    Parameters

    • number: string

    Returns BigInteger

over

  • Alias for the divide method.

    Parameters

    • number: number

    Returns BigInteger

  • Alias for the divide method.

    Parameters

    Returns BigInteger

  • Alias for the divide method.

    Parameters

    • number: string

    Returns BigInteger

plus

  • Alias for the add method.

    Parameters

    • number: number

    Returns BigInteger

  • Alias for the add method.

    Parameters

    Returns BigInteger

  • Alias for the add method.

    Parameters

    • number: string

    Returns BigInteger

pow

  • Performs exponentiation. If the exponent is less than 0, pow returns 0. bigInt.zero.pow(0) returns 1.

    Parameters

    • number: number

    Returns BigInteger

  • Performs exponentiation. If the exponent is less than 0, pow returns 0. bigInt.zero.pow(0) returns 1.

    Parameters

    Returns BigInteger

  • Performs exponentiation. If the exponent is less than 0, pow returns 0. bigInt.zero.pow(0) returns 1.

    Parameters

    • number: string

    Returns BigInteger

prev

  • Subtracts one from the number.

    Returns BigInteger

subtract

  • Performs subtraction.

    Parameters

    • number: number

    Returns BigInteger

  • Performs subtraction.

    Parameters

    Returns BigInteger

  • Performs subtraction.

    Parameters

    • number: string

    Returns BigInteger

times

  • Alias for the multiply method.

    Parameters

    • number: number

    Returns BigInteger

  • Alias for the multiply method.

    Parameters

    Returns BigInteger

  • Alias for the multiply method.

    Parameters

    • number: string

    Returns BigInteger

toJSNumber

  • toJSNumber(): number
  • Converts a bigInt into a native Javascript number. Loses precision for numbers outside the range.

    Returns number

toString

  • toString(radix?: number): string
  • Converts a bigInt to a string.

    Parameters

    • Optional radix: number

    Returns string

valueOf

  • valueOf(): number
  • Converts a bigInt to a native Javascript number. This override allows you to use native arithmetic operators without explicit conversion.

    Returns number

xor

  • Performs the bitwise XOR operation.

    Parameters

    • number: number

    Returns BigInteger

  • Performs the bitwise XOR operation.

    Parameters

    Returns BigInteger

  • Performs the bitwise XOR operation.

    Parameters

    • number: string

    Returns BigInteger