Re: bignum incompatible with looks_like_number() ???



In article <4684f46f$0$30511$afc38c87@xxxxxxxxxxxxxxxxxxxx>,
"Sisyphus" <sisyphus1@xxxxxxxxxxxxxxxxx> wrote:

Well, I started by reading this carefully:
http://perldoc.perl.org/bignum.html

As it says:
------------------------------------
If you do
use bignum;

at the top of your script, Math::BigFloat and Math::BigInt will be loaded
and any constant number will be converted to an object (Math::BigFloat for
floats like 3.1415 and Math::BigInt for integers like 1234).
------------------------------------

That's about all it does, all it ever has does, and all it ever will do.

It's just a convenient way of working with the Math::Big* modules. It
doesn't mean that perl has suddenly been transformed into something that
natively handles numbers with magically-extended precision. If you want the
extended precision you still have to stay within the realm of the Math::Big*
modules - or you can use other packages that provided extended precision
(Math::Pari, Math::GMP, Math::MPFR, etc.)

There's no mention of 'looks_like_number' anywhere on that page.


Then I found a bunch of stuff like this:
http://rt.perl.org/rt3//Public/Bug/Display.html?id=27606


That's just a discussion of a bug in looks_like_number() - whereby
looks_like_number(undef) returned true. I don't see the relevance of that in
the context of this thread. The bug is fixed in perl 5.8.8 (and perhaps
earlier - I haven't checked).

Sisyphus, you have chosen your handle well.

Please give some examples of how you imagine bignum is SUPPOSED to be
used.

Please include $x = 2**512+0.0 in your examples.

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: bignum incompatible with looks_like_number() ???
    ... use bignum; ... at the top of your script, Math::BigFloat and Math::BigInt will be loaded and any constant number will be converted to an object. ... It doesn't mean that perl has suddenly been transformed into something that natively handles numbers with magically-extended precision. ... If you want the extended precision you still have to stay within the realm of the Math::Big* modules - or you can use other packages that provided extended precision ...
    (comp.lang.perl.modules)
  • 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 0.22
    ... I found a problem related with calculating Catalan's numbers ... Evidently "bignum" has more to do and is more complicated, and consequently, ... I don't know if the bug is in the documentation ...
    (comp.lang.perl.modules)
  • Re: bignum incompatible with looks_like_number() ???
    ... bignum is intended to be fully compatible with looks_like_number ... keeping with the Perl philosophy, ... with XIRR that I described in my original post was such a case --- ... investigating the problem and helping the developers fix it. ...
    (comp.lang.perl.modules)