// Integer `{}` formatting across the full signed/unsigned range. // // Regression (issue 0090): the `{}` formatter was s64-based — it negated // the value to print the sign (so s64::MIN, whose magnitude is // unrepresentable as a positive s64, rendered as a bare "-"), and it had // no unsigned-aware path (so a u64 all-ones value printed as the s64 // reinterpretation, "-1"). Both extremes now render correctly: signed // MIN prints all its digits, and unsigned integers print as unsigned // decimal across all 64 bits. #import "modules/std.sx"; main :: () { // Signed extreme: magnitude is never negated, so MIN survives. print("s64.min={}\n", s64.min); print("s64.max={}\n", s64.max); // Unsigned extreme: all 64 bits as unsigned decimal, not -1. print("u64.max={}\n", u64.max); // Spread across widths — signed. print("s8.min={} s8.max={}\n", s8.min, s8.max); print("s16.min={} s16.max={}\n", s16.min, s16.max); print("s32.min={} s32.max={}\n", s32.min, s32.max); // Spread across widths — unsigned (max is all-ones for that width). print("u8.max={} u16.max={}\n", u8.max, u16.max); print("u32.max={}\n", u32.max); // Mins of unsigned widths and zero. print("u8.min={} u64.min={} zero={}\n", u8.min, u64.min, 0); // Ordinary signed/unsigned values still print correctly. neg : s32 = -42; pos : u32 = 4000000000; print("neg={} pos={}\n", neg, pos); }