Bin → int fails unless the bin is whole, or out_of_range when it is whole but too big for the integer.
whole.zg
# bin → int fails unless the bin is whole (decided 2026-09-21), or `out_of_range` when it is whole but# too big for the integer (owner, 2026-09-30: a). Rounding is said first.MAIN{let'x':bin64=2.0;let'y':bin64=2.7;let'a':=to.int32['x']otherwise-1;# whole: 2let'b':=to.int32['y']otherwise-1;# not whole: fails → -1let'c':=to.int32[std::round['y']]otherwise-1;# said: 3let'd':=to.int32[std::floor['y']]otherwise-1;# said: 2let'e':=to.int32[std::trunc[0.0minus'y']]otherwise-1;# said: -2std::print.useful['a'," ",'b'," ",'c'," ",'d'," ",'e',newln];let'big':bin64=10000000000.0;let'g':=to.int32['big']otherwise-1;# whole but too big for an int32: out_of_range → -1std::print.useful['g',newln];let'f':=to.int32['y']otherwise{not_whole{std::print.useful["2.7 is not whole",newln];std::exit[0];}out_of_range{std::print.useful["too big",newln];std::exit[0];}};}