On my 32-bit system in Bash: $ printf '%u\n' -1 18446744073709551615 $ echo $((2**63-1)) 9223372036854775807 $ echo $((2**63)) -9223372036854775808
On Sat, Jan 1, 2011 at 11:48 AM, Stephane CHAZELAS <stephane_chaze...@yahoo.fr> wrote: > 2010-12-31, 11:33(-07), Bob Proulx: > [...] >> Your expressions above are overflowing the value of your system's >> maximum integer size. You can read the system's maximum integer size >> using getconf. >> >> $ getconf INT_MAX >> 2147483647 > [...] > > POSIX requires that arithmetic expansion be using at least > signed longs, so getconf INT_MAX wouldn't necessarily be > correct. > > -- > Stephane >