[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Fun with infinity



Julien Quint wrote:
>Does any one know where I can find information about the seemingly magical 
>string "inf" ? It looks like this string -- and even, *any* starting with 
>"inf", "+inf" or "-inf" (this seems to come from the IEEE standard on 
>floating numbers) -- behaves like the infinity, i.e. any number will be 
>lesser than "inf" and greater than "+inf". Since I found no documentation 
>on it, I guess it is quite a hidden, perhaps old feature; but it was 
>pointed out to me that there was a bug fix in perl5.6.1 related to it -- it 
>does not issue any warning when compared to a number.
>
>So, where is it documented, and it is a good idea to use it? I found some 
>traces in perldata and some mentions to NaN in perlop, but that's not 
>much...

>From bleadperl's sv.c:
/*
=for apidoc looks_like_number

Test if an the content of an SV looks like a number (or is a
number). C<Inf> and C<Infinity> are treated as numbers (so will not
issue a non-numeric warning), even if your atof() doesn't grok them.

=cut
*/

Perl 5.6.1's perlapi.pod has a shorter version of that description that
doesn't mention inf, so I'm guessing it's a recent patch, and will be
part of 5.7.2.

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe