Re: nans, infs, and vomit
by dHarry (Abbot) on Sep 01, 2008 at 13:41 UTC
|
No IEEE rationale, the standard dealing with this stuff is IEEE 754 (and its revision IEEE 754r) but it only discusses things like the bit patterns for representing those values.
I recently followed the discussion on your post How to create nan/inf with interest. In Perl 6 everything will be better, but when I read A Romp Through Infinity I was a bit puzzled/confused.
In mathematics it is well defined but outside of math it seems to depend on the specific domain, i.e. you can find thousands of papers discussing infinity/NaN on IEEE. Enjoy:-)
Cheers,
dHarry
Update:
IEEE-754 References for the NaN/Inf inclined monk.
| [reply] |
|
|
No IEEE rationale
In a nutshell then ... what is it that inspired this notion that the strings "nan"/"inf" should actually become nans/infs when used numerically ? Was it something that the perl porters dreamed up all by themselves ?
It sure has been giving me some headaches lately. (Actually, it's the lack of uniformity across different operating systems that's the problem. If they all did the same thing, no matter how distasteful that "same thing" was, life would be much simpler :-)
Cheers, Rob
| [reply] |
|
|
| [reply] |
|
|
|
|
|
Re: nans, infs, and vomit
by ysth (Canon) on Sep 02, 2008 at 02:52 UTC
|
FWIW, this is my fault, to the extent that I fixed it after it had been broken for a very long time.
And it was back in 5.8.8. The relevant IEEE standard would be here (one-time registration required).
If you'd like to make it work on non-POSIX platforms, please do.
| [reply] |
Re: nans, infs, and vomit
by Anonymous Monk on Sep 01, 2008 at 14:07 UTC
|
perl -V:d_isnanl -V:d_isnan -V:d_isinf -V:d_isfinite
http://search.cpan.org/grep?cpanid=RGARCIA&release=perl-5.10.0&string=NaN&n=1&C=0#pod/perlfunc.pod | [reply] [d/l] |
Re: nans, infs, and vomit
by Anonymous Monk on Sep 01, 2008 at 13:39 UTC
|
I understand it has something to do with the underlying libc, but I'm also wondering what the underlying rationale is (if there *is* any). Is there, eg, some IEEE standard that encourages this nauseating behaviour ?
http://en.wikipedia.org/wiki/NaN | [reply] |
|
|
http://en.wikipedia.org/wiki/NaN
Already been there ... couldn't spot anything relevant to nanification/infinication of strings. Did I miss something ?
Cheers, Rob
| [reply] |