develooper Front page | perl.perl5.porters | Postings from July 2001

Math-BigInt v1.36 out

Thread Next
From:
Tels
Date:
July 9, 2001 13:21
Subject:
Math-BigInt v1.36 out
Message ID:
200107092020.QAA5612953@www08.hway.net
-----BEGIN PGP SIGNED MESSAGE-----

Moin [grumble need to retype msg since disc was full...],

first some important info: bloodgate.com is still down, I can not read my
mail there. So please use tels@bonn-online.com for now. It will vanish at
the end of July, but is more reliable. Sorry for any inconvienence this
may have caused.

The new version is out (along with new versions of Math::Big, Math::String
and the still shiny Math::BigInt::BitVect). Enjoy!

There were some minor (but still important changes) and one major change.
Please read carefully. First the minor ones:

  Various small fixes and error corrections in code, tests, comments and
  docs. Especially the added is_positive(), is_negative() and the
  improvemed handling of +inf and -inf comes to mind.
  The ACCURACY file was incorporated into the pod, so that the Perl core
  also gets the documentation.
  Fixed the long standing bug in fdiv(), that caused the rewritten fsqrt()
  to fail for most of it's arguments. The problem existed in all rewritten
  versions of BigFloat.pm and appeared when the length of $y was (much)
  greater than the length of $x:

        use Math::BigFloat;

        print 2 /
        Math::BigFloat->new('25.0249960007998400319936012797'),"\n";

  would output '0.079' instead of '0.07992009269196...'.
  bmul() is now faster in nearly every case due to internal optimization. It
  is also _much_ faster when the second argument contains lot's of decimal
  zeros; when it contains nearly only zeros mul goes from O(N*N) to O(N).

Now the major one:

  All the ugly perl-math code was ripped^Wtorn out^W^Wcarefully removed from
  Math::BigInt and stuffed^Wthrown^Wplaced into Math::BigInt::Calc. While
  no changes on the outside are apparent (as so often it is the case with
  foul^Wrotten cores^Wmessy systems), this allows you to use another
  library to do the magic^Wmath. Oh, I think my Ctrl-W key just broke...

  You can use another lib like Math::BigInt::BitVect by this:

        use Math::BigInt lib => 'BitVect';

        $x = Math::BigInt->new(2);
        $u = $x ** 100_000;

  On a 850 Mhz Athlon the "lib => 'BitVect'" part makes the difference
  between 35 and 0.05 seconds. ;) Yes, I know this particulary benchmark is
  unfair on the perl code, but who said I am fair? ;o)

  If anyone want's to port his/her pet math lib to the new MBI interface,
  just ask for help. It really _is_ easier now than ever!

What I did not address was BS2000 (I am still trying to lay hands on such a
system to find the actual failures) and Os390/UTS (because the problems with
these systems is not BigInt, but rather either Perl or the Bigint testsuite.
And I do not feel like sweeping failures under the carpet today ;)

Thanx for listening,

Tels

PS: Jarkko: You will need the following files:

        Math/BigInt.pm
        Math/BigFloat.pm
        Math/BigInt/Calc.pm
        t/bigint.pm
        t/bigflt.pm
        t/bigintc.pm
        t/mbimbf.t

I also produced a patch and I can upload it somewhere, but it is 41 kB
gziped (and my first attempt and a multi-file patch). Also, there may be
problems due to the tests for Bigint beeing under lib/Math/BigInt/t since
Math/BigInt/Calc.pm is also there!?

- --
perl -MMath::String -e 'print \
Math::String->from_number("215960156869840440586892398248"),"\n"'

 http://bloodgate.com/thief/     Thief - The Dark Project
 http://bloodgate.com/perl       My current Perl projects
 http://freedomforlinks.de       Fight for your right to link.
 PGP key available on http://bloodgate.com/tels.asc or via email.


-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: latin1

iQEVAwUBO0oRgncLPEOTuEwVAQEnWgf+J7gDQCGRbgS+slpMtcopMF9IHZvt8+Cj
L5Naw90Vqqzl9HF+wXRJpt/PakMtGFSDaYLGAvuLCxfFs2lpwxqcUB7R2msGGMlc
e4h1LbBx3b/xdKwpD5XQ5EbOBlDcPoWQhGWe8W2/pS8ntUPv77/Y1yogF7+ZP7u3
vG+7Z1tJzbhZFeE8Xws0Ot5N/AwkMDssE9x9p0+zFTeTQAInQyZSPu/6Qv3Lvo9j
1Fkhjq/6Yw+01DPz/GhsZyY9c7G/H4xowB7eV2J6qhj6bjCWKu3ouq9zFXldsVtk
JsOrXX1mGtlzI0i+99UWX1LTO5O7HFodvjlc6jGNoPbV25a1v0iHqw==
=K0c1
-----END PGP SIGNATURE-----

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About