a long integer division bug in perl? 
Author Message
 a long integer division bug in perl?

I am progarmming a perl routine in which a long integer div is
required but I find something wired like:

  $n = 1234567890123456789;
  $y = sprintf ("%.5f", $n/36);
  print $y;

the correct answer is 34293552503429355.25 but i got
34293552503429356.

what's wrong? how to fix this?


i took a couple of hours on it.... is it a stuipd question?

rgds,
stephen



Sun, 23 Nov 2003 23:05:41 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. How do I do integer division in Perl?

2. integer division

3. Force Integer Division??

4. Using long integer in PERL

5. Long integers in PERL

6. Converting long integers to hex and vice versa

7. How to convert a long integer into hex

8. Perl bug with 32-bit integers..

9. Possible bug - integer div and mod don't match

10. integer.pm bug?

11. perl5 large integer conversion bug

12. Serious integer arith bug in 5.003

 

 
Powered by phpBB® Forum Software