develooper Front page | perl.perl5.porters | Postings from April 2006

Re: [perl #38899] nondeterministic perl floating point math

Paul Johnson
April 11, 2006 16:11
Re: [perl #38899] nondeterministic perl floating point math
Message ID:
On Tue, Apr 11, 2006 at 11:42:22AM -0700, Justin Palmer wrote:

> I think this one is pretty self-explanatory.  I can't seem to 
> generate another number that this sort of problem happens with, 
> and I haven't looked harder to find out what other numbers this 
> happens to.  Any idea what's going on?  Bad machine language-perl 
> float interaction, I bet.

> $ perl -e 'print int(70.7/0.1)."\n";'
> 707
> $ perl -e 'print int(70.8/0.1)."\n";'
> 707

Thanks for your report.  Please see:

perldoc -q 999
perldoc perlnumber

I don't think this is a bug in perl.

Paul Johnson - Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About