def finite_number

bend-schema-lib@0.4.1.0 · core.bend:169

import bend-schema-lib@0.4.1.0/core.bend as Core
import Base

169# JSON numbers use IEEE-754 binary64 bits. The exponent occupies the high
170# word's bits 20 through 30; all ones denotes infinity or NaN.
171def finite_number(bits: NumberBits) -> Bool:
172  match bits:
173    case NumberBits{+hi, lo}:
174      Bool.not(U32.is_eq(U32.and(hi, 2146435072), 2146435072))

Uses (5)

Used by (1)