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

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

Thread Previous | Thread Next
From:
Jarkko Hietaniemi
Date:
September 27, 2014 13:22
Subject:
Re: [perl #122856] Inconsistent string vs number handling for chr(Inf)
Message ID:
5426B9FA.2090907@iki.fi
On Saturday-201409-27, 9:08, Father Chrysostomos via RT wrote:
> 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. :-)

Okay, let me look at it.

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


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