develooper Front page | perl.perl5.porters | Postings from September 2014

[perl #122856] Inconsistent string vs number handling for chr(Inf)

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
September 27, 2014 13:08
Subject:
[perl #122856] Inconsistent string vs number handling for chr(Inf)
Message ID:
rt-4.0.18-439-1411823318-767.122856-15-0@perl.org
On Sat Sep 27 04:30:30 2014, jhi wrote:
> On Saturday-201409-27, 1:25, Father Chrysostomos via RT wrote:
> > $ perl5.21.5 -le 'print pack "A3", 0+inf'
> > Cannot pack Inf with 'A' at -e line 1.
> >
> > That one shouldn’t be sentenced.
> 
> I may have been a bit trigger happy in my sentencing.  There's a
> comparison with "fdFD" in pp_pack.c which results only in floating
> point pack being allowed with inf/nan, and then respective testing
> loop in infnan.t.

Thank you.  But I’m afraid your code needs to be rewritten. :-)

$ perl5.21.5 -le 'print pack "xf", 0+inf'
Cannot pack Inf with 'x' at -e line 1.

Eek!

-- 

Father Chrysostomos


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

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