On 2008–05–06, at 19:58, Chris Hall (via RT) wrote: Good news -- from the point of view of repeatability: I get the same results as you when running your test program on a 64-bit blead perl (patchlevel 33783). > The first section shows the effect. Where the integer division is > exact we > get the right integer result. Where it is not exact, the result is > floated, > with hopeless loss of significance ! Bad news from the point of view of understanding the phenomenon: I get the same results as you when I put -Minteger on the 64-bit perl command line; that is, when arithmetic operations are carried out with machine integers and fractional parts are truncated. Same if I put - Mbigint, replacing all machine arithmetic with arbitrary precision integer operations. These modules appear to be behaving themselves: domo:64-bit_perl-current$ ./perl -lwe '$x=2**60 + 3; print $x/2 - 2**59' 0 domo:64-bit_perl-current$ ./perl -Ilib -Minteger -lwe '$x=2**60 + 3; print $x/2 - 2**59' 1 domo:64-bit_perl-current$ ./perl -Ilib -Mbigint -lwe '$x=2**60 + 3; print $x/2 - 2**59' 1 Can you say why I should be getting the same results from your test program in all three cases? -- Dominic DunlopThread Previous | Thread Next