@haxall/haxall
    Preparing search index...

    Class BigInt

    Immutable arbitrary-precision integer.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    type$: Type

    Methods

    • Return the absolute value of this integer. If this value is positive then return this, otherwise return the negation.

      Returns BigInt

    • Bitwise-and of this and b.

      Parameters

      Returns BigInt

    • Returns the number of bits in the minimal two's-complement representation of this BigInteger, excluding a sign bit.

      Returns number

    • Set the given bit to 0. Equivalent to this.and(1.shiftl(b).not).

      Parameters

      • b: number

      Returns BigInt

    • Compare based on integer value.

      Parameters

      Returns number

    • Decrement by one. Shortcut is --a or a--.

      Returns BigInt

    • Divide this by b. Shortcut is a/b.

      Parameters

      Returns BigInt

    • Divide this by b. Shortcut is a/b.

      Parameters

      • b: number

      Returns BigInt

    • Return true if same both represent that same integer value.

      Parameters

      Returns boolean

    • Flip the given bit between 0 and 1. Equivalent to this.xor(1.shiftl(b)).

      Parameters

      • b: number

      Returns BigInt

    • The hash for a BigInt is platform dependent.

      Returns number

    • Increment by one. Shortcut is ++a or a++.

      Returns BigInt

    • Return if this Obj is immutable and safe to share between threads:

      • an instance of a const class
      • the result of toImmutable on List, Map, or Buf
      • a Func object may or may not be immutable - see sys::Func.
      • other instances are assumed mutable and return false

      Returns boolean

    • Return the larger of this and the specified BigInt values.

      Parameters

      Returns BigInt

    • Return the smaller of this and the specified BigInt values.

      Parameters

      Returns BigInt

    • Subtract b from this. Shortcut is a-b.

      Parameters

      Returns BigInt

    • Subtract b from this. Shortcut is a-b.

      Parameters

      • b: number

      Returns BigInt

    • Return remainder of this divided by b. Shortcut is a%b.

      Parameters

      Returns BigInt

    • Return remainder of this divided by b. Shortcut is a%b.

      Parameters

      • b: number

      Returns number

    • Multiply this with b. Shortcut is a*b.

      Parameters

      Returns BigInt

    • Multiply this with b. Shortcut is a*b.

      Parameters

      • b: number

      Returns BigInt

    • Negative of this. Shortcut is -a.

      Returns BigInt

    • Bitwise not/inverse of this.

      Returns BigInt

    • Bitwise-or of this and b.

      Parameters

      Returns BigInt

    • Add this with b. Shortcut is a+b.

      Parameters

      Returns BigInt

    • Add this with b. Shortcut is a+b.

      Parameters

      • b: number

      Returns BigInt

    • Return this value raised to the specified power. Throw ArgErr if pow is less than zero.

      Parameters

      • pow: number

      Returns BigInt

    • Set the given bit to 1. Equivalent to this.or(1.shiftl(b)).

      Parameters

      • b: number

      Returns BigInt

    • Bitwise left shift of this by b. Negative values call shiftr instead.

      Parameters

      • b: number

      Returns BigInt

    • Bitwise arithmetic right-shift of this by b. Note that this is similar to Int.shifta, not Int.shiftr. Sign extension is performed. Negative values call shiftl instead.

      Parameters

      • b: number

      Returns BigInt

    • -1, 0, 1 if the BigInt is negative, zero, or positive.

      Returns number

    • Return true if given bit is 1. Equivalent to this.and(1.shiftl(b)) != 0.

      Parameters

      • b: number

      Returns boolean

    • Returns a byte array containing the two's-complement representation of this BigInt.

      Returns Buf

    • Convert the number to an Decimal.

      This simply wraps the BigInt with Decimal with a 0 scale, equivilent mathematically to int * 2^0

      Returns number

    • Convert the number to an Float.

      If the value is out-of-range, it will return Float.posInf or Float.negInf. Possible loss of precision is still possible, even if the value is finite.

      Returns number

    • Get an immutable representation of this instance or throw NotImmutableErr if this object cannot be represented as an immutable:

      • if type is const, return this
      • if already an immutable List, Map, Buf, or Func return this
      • if a List, then attempt to perform a deep clone by calling toImmutable on all items
      • if a Map, then attempt to perform a deep clone by calling toImmutable on all values (keys are already immutable)
      • some Funcs can be made immutable - see sys::Func
      • if a Buf create immutable copy, see sys::Buf
      • any other object throws NotImmutableErr

      Returns Readonly<this>

    • Convert the number to an Int.

      If the value is out-of-range and checked is true, an Err is thrown. Otherwise the value is truncated, with possible loss of sign.

      Parameters

      • Optionalchecked: boolean

      Returns number

    • Return string representation in given radix. If width is non-null, then leading zeros are prepended to ensure the specified width.

      Parameters

      • radix: number
      • Optionalwidth: number

      Returns string

    • Return decimal string representation.

      Returns string

    • Trap a dynamic call for handling. Dynamic calls are invoked with the -> shortcut operator:

      a->x        a.trap("x", null)
      a->x() a.trap("x", null)
      a->x = b a.trap("x", [b])
      a->x(b) a.trap("x", [b])
      a->x(b, c) a.trap("x", [b, c])

      The default implementation provided by Obj attempts to use reflection. If name maps to a method, it is invoked with the specified arguments. If name maps to a field and args.size is zero, get the field. If name maps to a field and args.size is one, set the field and return args[0]. Otherwise throw UnknownSlotErr.

      Parameters

      Returns JsObj

    • Get the Type instance which represents this object's class. Also seeType.of or Pod.of.

      Returns Type

    • This method called whenever an it-block is applied to an object. The default implementation calls the function with this, and then returns this.

      Parameters

      • f: (arg0: this) => void

      Returns this

    • Bitwise-exclusive-or of this and b.

      Parameters

      Returns BigInt

    • Default value is 0.

      Returns BigInt

    • Write x.toStr to standard output followed by newline. If x is null then print "null". If no argument is provided then print an empty line.

      Parameters

      Returns void

    • Parse a Str into a BigInt using the specified radix. If invalid format and checked is false return null, otherwise throw ParseErr.

      Parameters

      • s: string
      • Optionalradix: number
      • Optionalchecked: boolean
      • ...args: unknown[]

      Returns BigInt

    • Translates a byte array containing the two's-complement binary representation of a BigInt into a BigInt.

      Parameters

      • bytes: Buf
      • ...args: unknown[]

      Returns BigInt

    • Returns a BigInt whose value is equal to that of the specified Int.

      Parameters

      • val: number
      • ...args: unknown[]

      Returns BigInt

    • Returns BigInt

    • Returns BigInt