bug-gmp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Not a bug report but a suggestion


From: Max Neunhoeffer
Subject: Not a bug report but a suggestion
Date: Wed, 16 Jan 2002 16:17:28 +0100
User-agent: Mutt/1.2.5i

Dear authors of GMP,

First I really want to express my compliments about GMP! It is an
astonishing piece of software. I am particularly impressed about
the hardware dependent optimizations. You did a very good job!

However, I found a place where there is still room for improvement:
Conversion of big integers into string output with respect to base 10.

I happened to calculate 12345678901^11111 (it has about 112000 decimal
digits). This took only 0.1 seconds or so but to write the result out
took about 3 seconds.

I wrote a little C routine using GMP to accomplish this task in about
0.14 seconds on the same machine.

The trick is simple: Just divide the number by a big power of 10 to
approximately cut it in two equal pieces and repeat this process.

I append my code, which is at the moment only good for positive 
integers but shows the principle. Please feel free to use the idea
or even the code. 

I am pretty sure that you already know this trick but as far as I see
it is not in the GMP library. Perhaps you are interested...

Best regards,
  Max Neunhoeffer

-- 
   //  //   Max Neunhöffer <address@hidden>
  //  //   Alexianergraben 4-6, 52062 Aachen, Germany
 //  //   Tel.: +49 241 406605 (private) / +49 241 8094550 (institute)
//  //   May the Source be with you!

Attachment: grips.c
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]