baml._trunc_to_int

(internal) Truncates `value` toward zero and returns the integer part, saturating to the full 64-bit machine range rather than BAML's narrower 63-bit `int` range, and mapping NaN to `0`. It never throws, so a saturated result for a very large magnitude or `±∞` input can itself land outside `[int.min_value(), int.max_value()]`.

Reference version

Signature

function baml._trunc_to_int(value: float) -> int throws never

(internal) Truncates value toward zero and returns the integer part, saturating to the full 64-bit machine range rather than BAML's narrower 63-bit int range, and mapping NaN to 0. It never throws, so a saturated result for a very large magnitude or ±∞ input can itself land outside [int.min_value(), int.max_value()].

Backs internal retry-delay math, whose inputs stay well within int's range in practice. User code should prefer the range-checked float.itrunc(), or the float-returning float.trunc(); this saturating form is deliberately not public surface.

Source:<builtin>/baml/float.bamlbytes 2304123120