Large integers

Bob Arning arning at charm.net
Thu Aug 3 16:57:15 UTC 2000


Helge,

On Thu, 03 Aug 2000 18:28:14 +0200 Helge Horch <Helge.Horch at munich.netsurf.de> wrote:
>Great, three ways to skin the cat.  Now for the real, large integers:
>
[snip]
>
>This is not what I expected.  I'd have to examine the algorithms more 
>closely, but maybe RAA or JM know what's going on.  (I thought that, given 
>the LI plugin, we might drop the special-case LI arithmetic in DSA, but the 
>simple replacement does not seem desirable.)

What the LI plugin _did_ allow us to do was to drop the DSA-specific plugin.

If you are puzzled by why the third example in:

>[100 timesRepeat: [(855 raisedTo: 2753) \\ 3233]] timeToRun --> 9944
>[100 timesRepeat: [855 raisedTo: 2753 modulo: 3233]] timeToRun --> 20
>[100 timesRepeat: [DigitalSignatureAlgorithm new raise: 855 to: 2753 mod: 
>3233]] timeToRun --> 90

took longer, it is that by promoting #\\\ to Integer rather than implementing the Integer version as

		^self \\ anInteger

you will use #digitDiv:neg: in all cases, but it is a primitive only for Large ints.

Cheers,
Bob





More information about the Squeak-dev mailing list