Skip to content
Konjure / spatial intelligence

i128

← Builtin reference

Signed 128-bit integer, from -170141183460469231731687303715884105728 through 170141183460469231731687303715884105727; checked arithmetic.

Signature

Integer arithmetic checks overflow; floating-point arithmetic rounds each operation at its declared precision and rejects nonfinite results. Mixed representations require explicit conversion, which rejects loss of range or precision. Values serialize as decimal strings so JSON hosts retain the exact value.

Methods

convert

convert[U]() -> Res[U, DataError]

Converts to explicit numeric dtype U or returns DataError when exact conversion fails.

Examples

Calculate at a declared precision

Both operands have this dtype; changing the annotation changes its range and precision.

Tick 0 · 0.00 s⌘ / Ctrl + EnterThis device
main.kj
Loading the language runtime…
Output 0
No output.
Expected output
42

Rust definition

Rust SDK Scalar with an explicit dtype and validated bits; exact scalar JSON uses strings.

See also