develooper Front page | perl.perl5.porters | Postings from August 2001

Re: inf handling in Perl incomplete

Thread Previous | Thread Next
From:
Tels
Date:
August 8, 2001 14:29
Subject:
Re: inf handling in Perl incomplete
Message ID:
perl.perl5.porters-41638@nntp.perl.org
-----BEGIN PGP SIGNED MESSAGE-----

Moin,

On 08-Aug-01 Kurt D. Starsinic tried to scribble about:
> On Wed, Aug 08, 2001 at 09:11:56AM +0100, Piers Cawley wrote:
>> Jarkko Hietaniemi <jhi@iki.fi> writes:
>> > While that someone is at it, "NaN" also needs fixing.  In there one
>> > needs to move more carefully, since there usually are two kinds:
>> > "signaling" and "quiet" NaNs.  The first kind gives SIGFPEs, the
>> > second doesn't.
>> > 
>> >    $x = NaN;
>> >    print "goofy\n" if 0/0 == NaN;  # should always print
>> >    print "spooky\n" if NaN == NaN; # should never print
>>     print "ooky\n" if NaN == 1;     # should never print. But does.
> 
>     I don't believe that the Perl documentation claims that the bareword
> `NaN' becomes an IEEE NaN in numeric context.  It just suggests that
> an IEEE NaN is `NaN' in string context.  Do you believe otherwise,
> or are you proposing a change?

Incidentily, up until today (well, 2 hours ago), I believed and would have
swonr that 'NaN' becomes an IEEE NaN. Oups. Can (read: is it possible) to
change that?

Problem arise also with use Math::BigInt :constant; It won't touch NaN, nor
inf because these are strings (barewords), and are thus not integer
constants. But Math::BigInt->new('inf') works fine, so :constant could
(should) cover them. Or so I think.

Cheers,

Tels

- -- 
perl -MMath::String -e 'print \
Math::String->from_number("215960156869840440586892398248"),"\n"'

 http://bloodgate.com/thief/     Thief - The Dark Project
 http://bloodgate.com/perl       My current Perl projects
 http://freedomforlinks.de       Fight for your right to link.
 PGP key available on http://bloodgate.com/tels.asc or via email 

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: latin1

iQEVAwUBO3GoxHcLPEOTuEwVAQHkqgf8Cr7ZGW6WSL9n5mvLT0z4KoRyE0uUfcNO
yJwDRk8F2Co2NVGBAKrFEbGfGEyZi7OagGdB+GF8LysKSQFWaYZcQ54ckEAKksZ3
OJLczgRbF0GEKsqw2Ml/ck8LMamSAhXuw6EWdkTVwsM+i4kg0SJascVpV21rf8N0
GRZQ0eGl4qghNv+x74Kk4gFhTGBcVWbgUd7GVh4k6/nLRga1Z6PVW3T2fcjnnqpY
wHloJzdE4wMDrK/CFqxOWHBjBG1qD89FLAZF9iaeVgtdr+IPviNg6cucxqSaDnJv
wTGG+vDc8WGAK7sEfrG0LMu9FAX5qBAKaKXp9XE/xh+0EVYGTIk2cA==
=HSkn
-----END PGP SIGNATURE-----

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