Re: bignum incompatible with looks_like_number() ???



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 =----
.



Relevant Pages

  • Re: Long division algorithm
    ... I've got someone who insists on talking to my server from Perl programs on ... Windows, and for some reason, can't get the Perl bignum library to work on ... The simple shift and reduce mul/mod in Perl, ... small enough modulus, and 1024 bit might be small enough. ...
    (sci.crypt)
  • Re: Rounding issue
    ... Quoth pacman@xxxxxxxxxxxxx (Alan Curry): ... Can a well-rounded, general-purpose language like perl ... "bignum" should be the default mode, and FPU speed freaks should be the ones ...
    (comp.lang.perl.misc)
  • Re: bignum incompatible with looks_like_number() ???
    ... extended precision you still have to stay within the realm of the Math::Big* ... That's just a discussion of a bug in looks_like_number- whereby ... The bug is fixed in perl 5.8.8 (and perhaps ... Please give some examples of how you imagine bignum is SUPPOSED to be ...
    (comp.lang.perl.modules)