develooper Front page | perl.perl5.porters | Postings from May 2008

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

Thread Previous | Thread Next
From:
Abigail
Date:
May 22, 2008 06:27
Subject:
Re: [perl #54590] "Can't take log of 0" error in perl 5.8.8. 64 bit
Message ID:
20080522132737.GB2791@abigail.be
On Wed, May 21, 2008 at 10:14:48AM -0700, Lourdes Pe??a Castillo wrote:
> # New Ticket Created by  "Lourdes Pe??a Castillo" 
> # Please include the string:  [perl #54590]
> # in the subject line of all future correspondence about this issue. 
> # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=54590 >
> 
> 
> 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.
> 
> Is this  a known issue with perl 5.8.8. for 64bits? Thanks!

I see a difference depending on whether Perl was build using 64 bit
integers or not, I get the error when running with 32 bit build, and
-309.602059991327962 when running with a 64 bit build. The version
(5.8.7, 5.8.8, 5.10.0) doesn't matter, nor does it matter whether it
was build with threads or not.

It seems that in a 32-bit build, 2.5e-310 gets constant folded to 0.



Abigail

Thread Previous | Thread Next


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