Re: Perl floating point addition oddness

2009-06-04 Thread Chas. Owens
2009/6/3 Kelly Jones : > perl -le 'printf("%f %f %f\n", 4294967295, 2147483647*2**32, > 2147483647*2**32+4294967295)' > > 4294967295.00 9223372032559808512.00 9223372036854775808.00 > > Why? The answer is really 9223372036854775807 (one number lower), and > it's obvious that adding 2 an

Re: Perl floating point addition oddness

2009-06-03 Thread Raymond Wan
Hi Kelly, Kelly Jones wrote: perl -le 'printf("%f %f %f\n", 4294967295, 2147483647*2**32, 2147483647*2**32+4294967295)' 4294967295.00 9223372032559808512.00 9223372036854775808.00 Why? The answer is really 9223372036854775807 (one number lower), and it's obvious that adding 2 and