Builds from a plain Dart int (positive or negative). value must
itself be a normal, double-safe Dart int (true for any literal or
value that didn't already come from a wider fixed-width type) —
i.e. |value| <= 2^53, so splitting it into hi/lo limbs with plain
arithmetic operators never forms an intermediate exceeding the
JS double-precision safe integer boundary.
Builds from an arbitrary signed BigInt, truncating to 64 bits like
a wrapping cast — mirrors Int32.fromBigInt / Int128.fromBigInt.
BigInt.toUnsigned gives the exact two's-complement bit pattern
directly, so this is correct for any magnitude/sign.
Detects overflow via round-trip: wrap-multiply then divide back out.
Avoids ever forming a >64-bit intermediate.
Detects overflow via round-trip: wrap-multiply then divide back out.
Avoids ever forming a >64-bit intermediate.
-other wraps back to Int64.min itself when other == Int64.min
(no positive counterpart in two's complement), so that case can't go
through addChecked(-other) like every other value can. this - Int64.min only fits the signed range when this is negative, in
which case the plain wrapping subtract is already exact.
Signed value as a BigInt — the general-purpose conversion, unlike
toInt which throws when the magnitude doesn't fit a double-safe
int. Mirrors Int32.toBigInt / Int128.toBigInt.
Truncating narrow, then reinterpret (wrapping, like a Rust as i32
cast). Same value as the toI32 getter, kept for naming consistency
with the other toIntNN/toUintNN converters.
Truncating division (toward zero), like Rust's / or C's /.
Int64.min ~/ Int64.minusOne wraps back to Int64.min (the one case
where the mathematical quotient doesn't fit).