Re: bignum 0.22



On Fri, 6 Jul 2007, Mumia W. wrote:

On 07/05/2007 10:08 PM, Sisyphus wrote:

"Mumia W." <paduille.4061.mumia.w+nospam@xxxxxxxxxxxxx> wrote in message
news:hq7ji.3972$Od7.1277@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On 07/05/2007 04:36 AM, gamo wrote:
On Thu, 5 Jul 2007, Sisyphus wrote:

"gamo" <gamo@xxxxxxxxxxxx> wrote in message
news:Pine.LNX.4.64.0707041540080.19628@xxxxxxxxx
Hello

I found a problem related with calculating Catalan's numbers

What is the problem ? (I don't see it.)

Cheers,
Rob

The problem is that this output lacks precision aparently

216489185503133990863274261791925599831200000000000000000000
853702637172735926234421145556838686126800000000000000000000
3366939372774715522158184331074634818182000000000000000000000
[...]

You can set the "accuracy" of the bignum module. Read "perldoc bignum"


Oh, yes ... I should've realised.

Is that a bug in bignum ? I didn't see it documented anywhere that there was
a default "accuracy" set.
The same issue does not arise if you explicitly 'use Math::BigInt;'.

Cheers,
Rob

Yes, I also noticed that Math::BigInt (or "bigint") works right out of the
box.

Evidently "bignum" has more to do and is more complicated, and consequently,
has more bugs. In this case, I don't know if the bug is in the documentation
or code; however, I think that the default accuracy should be given in the
POD.

Nonetheless, it can be queried by calling Math::BigFloat->accuracy().

Gamo, why did you choose bignum rather than bigint?


Because it's simple to use. It overloads any operation.
Fire and forget. No OOP nor especial commands.
If I need to use only BigInt, I'll check GMP::Mpz or Math::PARI, too.
PARI is another kind of animal, because it does functions.
Best regards,

--
http://www.telecable.es/personales/gamo/
perl -e 'print 111_111_111**2,"\n";'
.



Relevant Pages

  • 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, has more bugs. ... In this case, I don't know if the bug is in the documentation or code; however, I think that the default accuracy should be given in the POD. ...
    (comp.lang.perl.modules)
  • Re: bignum 0.22
    ... I found a problem related with calculating Catalan's numbers ... Is that a bug in bignum? ... Rob ...
    (comp.lang.perl.modules)
  • Weekly Python Patch/Bug Summary
    ... Patch / Bug Summary ... Help with Python codebase ... Update to Macintosh library documentation ... Segfaults on memory error ...
    (comp.lang.python)
  • Weekly Python Patch/Bug Summary
    ... Patch / Bug Summary ... typo in liblocale.tex ... subprocess documentation ... Registry not updated by 2.4b1 installer ...
    (comp.lang.python)
  • Re: Tired of 100s of stupid Getter/Setter methods
    ... > reading the documentation that the library developer wrote. ... ability to become familiar with an API. ... Given the choice between finding out about a bug as I'm writing the ... say about a language that's one of the more readable that I work in. ...
    (comp.lang.java.programmer)