ANN: DecInt 0.3 - Arithmetic for very large decimal integers

C

casevh

DecInt is a class that support arithmetic on very large decimal
integers.

For example, it can calculate the decimal form of the 42nd Mersenne
prime, all 7,816,230 digits, in less than 21 seconds. And less than 6
seconds if gmpy 1.01 is available.

This version is significantly faster than the prior version.

Multiplication used a combination of 4-way Toom-Cook and Nussbaumer
convolution. Pure Python multiplication is less than 10x slower than
GMP's hand optimised assembler code!

Division uses a new algorithm based on David M. Smith's division
algorithm. Pure Python division is 16x slower than GMP but can actually
be faster in some instances; for example, dividing a 2,000,000 digit
number by an 800,000 digit number.

DecInt can be found at http://home.comcast.net/~casevh/

(DecInt used to be called BigDecimal; I renamed it to avoid confusion
with the "decimal" class include with Python.)

Enjoy,

casevh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top