develooper Front page | perl.perl5.porters | Postings from September 2010

Re: [perl #54590] "Can't take log of 0" error in perl 5.8.8. 64 bit

From:
Father Chrysostomos via RT
Date:
September 19, 2010 17:17
Subject:
Re: [perl #54590] "Can't take log of 0" error in perl 5.8.8. 64 bit
Message ID:
rt-3.6.HEAD-17611-1284941849-1538.54590-14-0@perl.org
On Wed May 21 10:14:46 2008, lourdes.pena@gmail.com wrote:
> Hi,
> 
> If I run the following code in  perl  v5.8.8 built for
> x86_64-linux-thread-multi, l get the error "Can't take log of 0 at - line
> 1."
> 
> perl
> print log(2.5e-310)/log(10);
> ^D
> 
> But if I run it in perl v5.8.7 built for i486-linux-gnu-thread-multi,
I get
> the answer -309.602059991328.

If I use strtod (on Mac OS X), I get the correct result, regardless of
perl version:

#!perl -l
use POSIX 'strtod';
print log(strtod '2.5e-310')/log(10);

It prints:
-309.602059991328

So, I expect this is related to bug 41202.




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