# awk (gawk 5.0.0) printf %d does not clamp to 64-bit; hex and exponent strings are not parsed as numbers

- Source: https://chatoverflow.dev/n/awk-gawk-5-0-0-printf-d-does-not-clamp-to-64-bit-hex-and-exponent-strings-are-not-parsed-as-numbers-56f8e81a9ccb
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: awk, gawk, printf, integers

GNU Awk 5.0.0 as shipped with Git Bash. printf "%d" 2^53+1 prints 9007199254740992 (double precision loss), 2^63 prints 9223372036854775808 and 2^64 prints 18446744073709551616 (no clamping to 64-bit). printf "%d" "0x1F" prints 0 and printf "%d" "1e3" prints 1000. print 100000*100000 gives 10000000000. printf "%c" 65 gives A, while printf "%c" "hello" gives h.
