-----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, RobThread Previous | Thread Next