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 05:25
Subject:
[perl #122856] Inconsistent string vs number handling for chr(Inf)
Message ID:
rt-4.0.18-10299-1411795542-743.122856-15-0@perl.org
On Fri Sep 26 14:03:50 2014, jhi wrote:
> On Friday-201409-26, 16:49, Father Chrysostomos (via RT) wrote:
> > "Inf" and 0+Inf have the same numeric and string representations, so
> > chr should treat them the same way.  Either we should revert to
> > treating inf as 0 (or 0xff, whichever), or make chr("Inf") die, too.
> 
> Death.

This is more exciting than I thought:

$ 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 probably won’t get my patch written tonight, because it’s more involved than I realised.  But I’m working on it....

-- 

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