API Reference › BigInt › BigInt.to_int
method

BigInt.to_int

BigInt.to_int(a) -> int

Returns the value as a plain int when it fits in 32 bits, clamping to the int min/max otherwise. Use it to feed a small big-integer back into ordinary code.

Example

program Demo {
  handler Step phase Update {
    let n = BigInt.to_int(BigInt.from(2024))
  }
}
← All symbols