develooper Front page | perl.perl5.porters | Postings from April 2012

[perl #28538] Math::BigInt doesn't grok "0 but true"

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
April 29, 2012 12:29
Subject:
[perl #28538] Math::BigInt doesn't grok "0 but true"
Message ID:
rt-3.6.HEAD-4610-1335727757-396.28538-15-0@perl.org
On Sun Apr 29 11:27:06 2012, doy@tozt.net wrote:
> On Sun, Apr 29, 2012 at 11:01:25AM -0700, Father Chrysostomos via RT
wrote:
> > On Sun Apr 29 10:13:39 2012, Hugmeir wrote:
> > > (Tangentially related, Data::Dumper still doesn't understand dualvars.
> > > Nowadays, I imagine that to detect one of those you could use B to get
> > > the flags, and check if it's both p?POK and p?[IN]OK)
> > 
> > But that alone would bring up many false positives.
> > 
> > I wouldn’t consider $x a dualvar after ‘$x = "3.0"; 0+$x’.
> 
> I think that just not looking at the p variants would fix that issue -
> just look for things that are both POK and [IN]OK.

Not so.

$ perl5.15.9 -e '$x = "3.0"; 0+$x; use Devel::Peek; Dump $x'
SV = PVNV(0x802340) at 0x822330
  REFCNT = 1
  FLAGS = (IOK,NOK,POK,pIOK,pNOK,pPOK)
  IV = 3
  NV = 3
  PV = 0x301580 "3.0"\0
  CUR = 3
  LEN = 16

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=28538

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