>On Wed, Oct 26, 2016 at 12:34:54PM +1100, sisy...@optusnet.com.au wrote: >> Hi, >> >> By way of demonstration: >> >> ########################## >> use Devel::Peek; >> >> $x = 1.75; >> $y = 2.25; >> >> Dump $x; >> print $x; >> Dump $x; >> if($y ne 'hello') {Dump $y} >> ######################### >> >> $x and $y initially have (NOK, pNOK) flags set. >> And with perl 5.20 and later, that's the way it stays. >> >> But with perl 5.18 and earlier, both $x and $y end up with >> (NOK,POK,pNOK,pPOK) flags set. >> >> Which is the correct behaviour ? > > It's a bug fix: > > commit b127e37e51c21b0a36755dcd19811be931a03d83 > Author: Karl Williamson <pub...@khwilliamson.com> > Date: Mon May 13 07:35:35 2013 -0600 > > PATCH: [perl #108378] [perl #115800] > This patch solves two tickets. Both are a result of the > stringification > of a floating number being sticky, so that the character representing > the decimal point may be from an old locale. The patch solves this by > not retaining the stringification of NVs. Thanks Dave. I just noticed that the stringification of NVs *is* retained if the NV is an inf or a nan. That seemed a bit odd at first - but I guess it's acceptable (as neither inf nor nan contain a decimal point). Cheers, RobThread Previous | Thread Next