Re: bignum incompatible with looks_like_number() ???
- From: C B <cb0@xxxxxxx>
- Date: Thu, 28 Jun 2007 20:29:19 +0700
Here's what I found out after digging into this issue:
1. bignum is intended to be fully compatible with looks_like_number()
and with all other arithmetical functions and operators.
2. If you try, for example,
$x = 2**512 + 0.1;
and you get an overflow or similar error, then inserting the single line:
use bignum;
into your Perl program should automagically extend the precision of all
calculations to whatever they need to be to get a useful result. In
keeping with the Perl philosophy, there are no arbitrary Perl-imposed
limits on how far you can take this --- you can go as far as memory and
other external constraints permit.
3. These statements apply to Perl 5 (there's a similar capability is in
Perl 6, but I believe it's invoked differently).
4. These statements fairly represent the _intent_ of the developers of
Bignum and its friends BigInt and BigFloat. There are, however, several
problem cases and boundary issues associated with overloading operators
like + and / and things like initialization constants. The situation
with XIRR that I described in my original post was such a case ---
is_a_number() incorrectly failed when it was called on an integer under
use bignum;
However, running exactly the same code under newer versions of certain
modules made the original problem go away.
5. If you decide to try
use bignum;
and it fails, you will be doing your fellow Perl users a good deed by
investigating the problem and helping the developers fix it.
CB
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
.
- Follow-Ups:
- Re: bignum incompatible with looks_like_number() ???
- From: Sisyphus
- Re: bignum incompatible with looks_like_number() ???
- References:
- bignum incompatible with looks_like_number() ???
- From: C B
- Re: bignum incompatible with looks_like_number() ???
- From: Sisyphus
- Re: bignum incompatible with looks_like_number() ???
- From: C B
- Re: bignum incompatible with looks_like_number() ???
- From: Sisyphus
- bignum incompatible with looks_like_number() ???
- Prev by Date: Re: HTML::Template, is it possible to nest <TMPL_VAR> inside a <TMPL_IF>?
- Next by Date: Re: Help with validating XML (DTD or Schema) with PERL
- Previous by thread: Re: bignum incompatible with looks_like_number() ???
- Next by thread: Re: bignum incompatible with looks_like_number() ???
- Index(es):
Relevant Pages
|
|