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

Re: Bug in setting of POK flag ?

Thread Previous
From:
Dave Mitchell
Date:
October 26, 2016 08:19
Subject:
Re: Bug in setting of POK flag ?
Message ID:
20161026081902.GP3128@iabyn.com
On Wed, Oct 26, 2016 at 12:34:54PM +1100, sisyphus1@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 <public@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.


-- 
Nothing ventured, nothing lost.

Thread Previous


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