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

Re: inf handling in Perl incomplete

Thread Previous | Thread Next
From:
Jarkko Hietaniemi
Date:
August 8, 2001 18:59
Subject:
Re: inf handling in Perl incomplete
Message ID:
20010808205855.A12037@chaos.wustl.edu
On Wed, Aug 08, 2001 at 03:18:39PM -0700, Kurt D. Starsinic wrote:
> On Wed, Aug 08, 2001 at 11:26:42PM +0200, Tels wrote:
> > 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
> 
>     My reading of IEEE is that 0/0 is NaN, and semantically, NaN != NaN, so
> the above should never print.

Ahhh, true.  Don't know what I was thinking.

>     I don't want to see bareword NaN and Inf upgrade automagically.  I think
> it's more cruft, and there isn't just one NaN anyway.  I wouldn't mind a
> pragma that made, e.g., 0/0 or sqrt(-1) return the appropriate NaN instead
> of throwing an exception, though.

I am in the process of adding some more guts support for infinities
and nans.  Well, I *was* in the process of doing that but then the
fileserver where my working directory is, gave up the
delivering-the-bits-business.

P.S.  Pssst, you certain you don't want sqrt(-1) returning 'i'? :-)

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

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