develooper Front page | perl.perl5.porters | Postings from November 2000

Math::BigInt rewrite

From:
Marc Lehmann
Date:
November 21, 2000 05:57
Subject:
Math::BigInt rewrite
Message ID:
20001121145139.C29844@cerebro.laendle
I forward this because Tels has problems posting to perl5-porters (just
like me, but I'll try my luck anyway):

----- Forwarded message from tels@bloodgate.com -----

-----BEGIN PGP SIGNED MESSAGE-----

Helo all,

I am currently rewriting Math::BigInt. While I am at this, I also developed
two modules, that depend on Math::BigInt, Math::String and Math::Roman (I
seem to be infected with a bad case of Perligate *drool* *pant*).

My work-in-progress can be found at http://bloodgate.com/pub/perl/bigint.zip

The new Math::BigInt is subclassable, subsequently faster, fixes some
bugs and has some more features (and probably new bugs ;o).

Most of the work is done but some things remain still to do:

Math::BigInt - bug in mul or div (2**150 is wrong), this effects also band,
bxor etc.
Math::String - no regression tests yet, bug with multiply charsets (maybe I
drop these)
Math::Roman - practically done.

Wether I rewrite Math::BigFloat to use M::I (or rewrite it at all), or vice
versa I do not know. I think Math::BigInt could be much faster when the
numbers are stored as normalited float arrays. I have no experiencs with
floatingpoint math, though.

Now I had that wierd idea about Math::Egypt. The egypts used a similiar
system like the Romans and had 7 symbols representing 1,10,100 etc. I
thought up some chars for the different symbols to represent them in ASCII:

I 1             Stroke
H 10            Hobble (for cattle)
C 100           Rope coil (could use @ for coolness)
L 1000          Lotus
F 10000         Finger
T 100000        Tadpole
G 1000000       God

So, 1999 would be "LCCCCCCCCCHHHHHHHHHIIIIIIIII". Rather longish, though.

The Egypts used to stack the symbols, but this can not be done in one line.
HTML tables, anyone? ;)

Well, this seems to do the trick. Btw, the nice thing is that
Math::Roman would be already able to deal with Egypt, because you can
simple redefine the token list. Perhaps I should name it Math::Ancient? 

Any comments, hints, suggestions etc are welcome.

Thanx for listening, and all your astounding work.

Cheers,

Tels

PS: pod2html -- version is missing (I use Perl 5.6.0), man pod2html says to
look in Pod::Html for known-bug-list, but this does not contain any. My
problem is that "foo()" gets to the equivalent of C<foo()>, but
"Math::Roman::bstr()" not. Also "(baz(), bar(), foo())" gets only foo() to
C<> and you seem not be able to effect this. If this is not already
fixed, please ask me for a patch.




Regards,

Tels

- --
 "Why do you go so slowly? Do you think this is some kind of game?"
 http://bloodgate.com/thief/     Thief - The Dark Project
 http://bloodgate.com/aifilter   Rewriting the HTML as we know it.
 http://freedomforlinks.de       Fight for your right to link. 
 PGP key available on http://bloodgate.com/tels.asc or via email.

The email address contained in the From/Reply of this email is NOT
to be displayed on webpages, entered into any mailing lists, given 
to other people, used to send me electronic greeting cards without
my written, signed permission. No SPAM nor UCE, either! Thank you!
And PLEASE refrain from forwarding me chain letters, massmailings,
or pyramid schemes.

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

iQEVAwUBOhl4PXcLPEOTuEwVAQENlwf+OkDQrPag4B72a8MaTPEszY2FD0j8ZTyF
sHh2Y7UTywaILg7HCUGZ5X/q7BBQNNUt6IiOTwBBXtyFJ4eyaFAhDllWueNFwbxO
ACixpf2cNyV1oi9d1h07ATGTyp4m89tEJAVUk7abKTE2fUPrmbdxbeIoaGLUywIw
oKNSUV84E/v4cX5o+puirr5CEKt9fP9OOdvePaKTyMU1+HQEQ/4G8zqzKmWanvtu
RUCdjISnmZcaMSWSGqKrGGZkKWeNJTVKaAV3UE4KqoENsuOUNhT38TfReGPZKYmp
ckfVPjUAqnmE2blAnBNl+wiB2C3CI7UmVI1he1IQYqDNAXqdZxPTiw==
=Mu18
-----END PGP SIGNATURE-----


----- End forwarded message -----

-- 
      -----==-                                             |
      ----==-- _                                           |
      ---==---(_)__  __ ____  __       Marc Lehmann      +--
      --==---/ / _ \/ // /\ \/ /       pcg@opengroup.org |e|
      -=====/_/_//_/\_,_/ /_/\_\       XX11-RIPE         --+
    The choice of a GNU generation                       |
                                                         |



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