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

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

From:
Paul Johnson
Date:
April 11, 2006 16:11
Subject:
Re: [perl #38899] nondeterministic perl floating point math
Message ID:
20060411231045.GO3612@pjcj.net
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 - paul@pjcj.net
http://www.pjcj.net



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About