develooper Front page | perl.perl5.porters | Postings from October 2013

Re: [perl #120363] perl-5.18.0 apparently miscalculates the NV 1e-298

Thread Previous | Thread Next
From:
sisyphus1
Date:
October 25, 2013 11:40
Subject:
Re: [perl #120363] perl-5.18.0 apparently miscalculates the NV 1e-298
Message ID:
1491C463F67D4F238F18D6202BFAE67D@OwnerPC311012


-----Original Message----- 
From: Zefram via RT
Sent: Friday, October 25, 2013 10:17 PM
To: sisyphus1@optusnet.com.au
Subject: Re: [perl #120363] perl-5.18.0 apparently miscalculates the NV 
1e-298

Sisyphus wrote:
>>I presume there would be other values that also produce the discrepancy,
>
>See [perl #41202], where Perl gets the wrong value and libc gets the
>right value for a text->float conversion where the value represented
>textually can be exactly represented as an NV.

Is there a connection ?
That looks quite different - I'm not doing any text-float conversion and 
perl represents the value 2^70 perfectly accurately:

Where nvtype is "double":
$ perl -le 'print scalar reverse unpack "b53", pack "F", 2 ** 70;'
10000000000000000000000000000000000000000000000000000

And where nvtype is "long double"
$ perl -le 'print scalar reverse unpack "b64", pack "D", 2 ** 70;'
1000000000000000000000000000000000000000000000000000000000000000

(Sorry if I've missed the point.)

Cheers,
Rob 


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