You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Printing an i128/u128 shows only its low 64 bits (f"{x}" of 1 << 100 prints 0) #1922
Found by the #1874 SIMD work (128-bit lanes); reproduced on the installed compiler (main 8f84428's release):
fn main:
let one: i128 = 1
let x = one << 100
print(f"{x >> 90}") // 1024 (the value is right)
print(f"{x}") // 0 (expected 1267650600228229401496703205376)
The value is correct (shift and == give the right answers); the Display/format path for i128/u128 formats the low 64 bits. Spec §4.1 lists i8…i128 and u8…u128 as primitives; a primitive that prints wrong is a silent wrong answer. Expected: full-width decimal (and hex/bin format specs) for 128-bit integers.
Fixed on main: 55d094b (#1929) — i128/u128 print their full value; unsigned and narrow values keep their width under a format spec; i64::MIN under :d no longer panics (LLVM and C backends); behav_1922_integer_format_full_width.
Activity
Integers print their whole value at their own width and signedness: 1…
Integers print at their full width and signedness (#1922); tests driv…
ehartford commentedon Sep 30, 2026
Fixed on main: 55d094b (#1929) — i128/u128 print their full value; unsigned and narrow values keep their width under a format spec; i64::MIN under :d no longer panics (LLVM and C backends); behav_1922_integer_format_full_width.
A narrow integer under a hex, binary or octal spec prints its own bit…
A narrow integer under a hex, binary or octal spec prints its own bit…
Runtime/Windows/fs: remove_tree trailing-slash link (#1951); VecRange…
#914: i128/u128 end to end — parse, primitive traits, acceptance (#2399)