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

Math::BigInt rewrite

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

----- Forwarded message from -----


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

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.



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.



- --
 "Why do you go so slowly? Do you think this is some kind of game?"     Thief - The Dark Project   Rewriting the HTML as we know it.       Fight for your right to link. 
 PGP key available on 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.

Version: 2.6.3i
Charset: latin1


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

      -----==-                                             |
      ----==-- _                                           |
      ---==---(_)__  __ ____  __       Marc Lehmann      +--
      --==---/ / _ \/ // /\ \/ / |e|
      -=====/_/_//_/\_,_/ /_/\_\       XX11-RIPE         --+
    The choice of a GNU generation                       |
                                                         | Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About