Class/Object

io.scalajs.npm.bignum

BigNum

Related Docs: object BigNum | package bignum

Permalink

class BigNum extends Object

Arbitrary-precision integer arithmetic using OpenSSL

Annotations
@RawJSType() @native() @JSImport( "bignum" , JSImport.Namespace )
Version

0.12.5

See also

https://www.npmjs.com/package/bignum

Linear Supertypes
Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BigNum
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new BigNum(initial: BigNumCompatible, base: Int = js.native)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def abs(): BigNum.this.type

    Permalink

    Return a new bignum with the absolute value of the instance.

  5. def add(n: BigNumCompatible): BigNum.this.type

    Permalink

    Return a new bignum containing the instance value plus n.

  6. def and(n: BigNumCompatible): BigNum.this.type

    Permalink

    Return a new bignum with the instance value bitwise AND (&)-ed with n.

  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def bitLength(): Int

    Permalink

    Return the number of bits used to represent the current bignum.

  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def cmp(n: BigNumCompatible): Int

    Permalink

    Compare the instance value to n.

    Compare the instance value to n.

    returns

    a positive integer if > n, a negative integer if < n, and 0 if == n.

  11. def div(n: BigNumCompatible): BigNum.this.type

    Permalink

    Return a new bignum containing the instance value integrally divided by n.

  12. def eq(n: BigNumCompatible): Boolean

    Permalink

    Return a boolean: whether the instance value is equal to n (== n).

  13. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def gcd(n: BigNumCompatible): BigNum.this.type

    Permalink

    Return the greatest common divisor of the current bignum with n as a new bignum.

  17. def ge(n: BigNumCompatible): Boolean

    Permalink

    Return a boolean: whether the instance value is greater than or equal to n (>= n).

  18. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  19. def gt(n: BigNumCompatible): Boolean

    Permalink

    Return a boolean: whether the instance value is greater than n (> n).

  20. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  21. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  22. def invertm(m: BigNumCompatible): BigNum.this.type

    Permalink

    Compute the multiplicative inverse modulo m.

  23. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  24. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  25. def jacobi(n: BigNumCompatible): Double

    Permalink

    Return the Jacobi symbol (or Legendre symbol if n is prime) of the current bignum (= a) over n.

    Return the Jacobi symbol (or Legendre symbol if n is prime) of the current bignum (= a) over n. Note that n must be odd and >= 3. 0 <= a < n. Returns -1 or 1 as an int (NOT a bignum). Throws an error on failure.

  26. def le(n: BigNumCompatible): Boolean

    Permalink

    Return a boolean: whether the instance value is less than or equal to n (<= n).

  27. def lt(n: BigNumCompatible): Boolean

    Permalink

    Return a boolean: whether the instance value is less than n (< n).

  28. def mod(n: BigNumCompatible): BigNum.this.type

    Permalink

    Return a new bignum with the instance value modulo n.

  29. def mul(n: BigNumCompatible): BigNum.this.type

    Permalink

    Return a new bignum containing the instance value multiplied by n.

  30. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  31. def neg(): BigNum.this.type

    Permalink

    Return a new bignum with the negative of the instance value.

  32. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  33. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  34. def or(n: BigNumCompatible): BigNum.this.type

    Permalink

    Return a new bignum with the instance value bitwise inclusive-OR (|)-ed with n.

  35. def pow(n: BigNumCompatible): BigNum.this.type

    Permalink

    Return a new bignum with the instance value raised to the nth power.

  36. def powm(n: BigNumCompatible, mn: BigNumCompatible): BigNum.this.type

    Permalink

    Return a new bignum with the instance value raised to the nth power modulo m.

  37. def probPrime(n: BigNumCompatible): Boolean

    Permalink

    Return whether the bignum is: * certainly prime (true) * probably prime ('maybe') * certainly composite (false)

  38. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  39. def rand(upperBound: BigNumCompatible = js.native): BigNum.this.type

    Permalink

    If upperBound is supplied, return a random bignum between the instance value and upperBound - 1, inclusive.

    If upperBound is supplied, return a random bignum between the instance value and upperBound - 1, inclusive.

    Otherwise, return a random bignum between 0 and the instance value - 1, inclusive.

    upperBound

    the upper-bound

  40. def root(n: BigNumCompatible): Boolean

    Permalink

    Return a new bignum that is the nth root.

    Return a new bignum that is the nth root. This truncates.

  41. def shiftLeft(n: BigNumCompatible): BigNum.this.type

    Permalink

    Return a new bignum that is the

    Return a new bignum that is the

    2^n

    multiple. Equivalent of the << operator.

    2^n }}}

  42. def shiftRight(n: BigNumCompatible): BigNum.this.type

    Permalink

    Return a new bignum of the value integer divided by

    Return a new bignum of the value integer divided by

    2^n

    . Equivalent of the >> operator.

    2^n }}}

  43. def sqrt(): BigNum.this.type

    Permalink

    Return a new bignum that is the square root.

    Return a new bignum that is the square root. This truncates.

  44. def sub(n: BigNumCompatible): BigNum.this.type

    Permalink

    Return a new bignum containing the instance value minus n.

  45. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  46. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  47. def toNumber(): Double

    Permalink

    Turn a bignum into a Number.

    Turn a bignum into a Number. If the bignum is too big you'll lose precision or you'll get ±Infinity.

  48. def toString(base: Int): String

    Permalink

    Print out the bignum instance in the requested base as a string.

    Print out the bignum instance in the requested base as a string.

    base

    the given base

    returns

    the requested base as a string

  49. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  50. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  51. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  52. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  54. def xor(n: BigNumCompatible): BigNum.this.type

    Permalink

    Return a new bignum with the instance value bitwise exclusive-OR

    Return a new bignum with the instance value bitwise exclusive-OR

    (^)

    -ed with n.

    (^) }}}

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped