home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.programming:3434 comp.programming:3435
- Newsgroups: comp.programming,comp.programming
- Path: sparky!uunet!utcsri!skule.ecf!torn!nott!bnrgate!bcars267!news
- From: emcoop@bnr.ca (hume smith)
- Subject: Re: Re: Arbitrary precision with large bases
- Message-ID: <21495.1993Jan7.112925@bcars148>
- Lines: 48
- Sender: news@bnr.ca (usenet)
- Nntp-Posting-Host: bcars148
- Organization: Bell-Northern Research, Ottawa, Canada
- X-Poster: Emacs-NNTP-0.1
- References: <martin.726416738@bert> <MARKT.93Jan7124834@wundt.harlqn.co.uk> <martin.726311424@bert> <1icne6INNpjb@uwm.edu> <21495.1993Jan6.094519@bcars148>
- Date: Thu, 7 Jan 1993 16:29:25 GMT
-
- In <martin.726416738@bert>, martin@math.rwth-aachen.de ( Martin Schoenert) said:
- > emcoop@bnr.ca (hume smith) writes:
- >
- > not quite true - see aho/hopcroft/ullman. f1*f2 can be done
- > in O(n log(n)) where n=max(log(f1), log(f2)). there's a rather large
- > constant involved though... it may be better to implement the two
- > and find out empirically when to switch methods.
- >
- > Well yes, but it is not so simple. Those fancier algorithms also have to
- > multiply digits (just not so many). That means that base 2^32 is still
- > going to win over base 10^10 (just not so much).
-
- i don't understand what you mean - AH&U describe their algorithm working
- bitwise, but i saw no particular tie to base 2. i've done it in Emacs Lisp
- using base 10000, only because it was easy to print... it should work
- in 2^whatever makes your hardware happy.
-
- (i also should say that i took some liberty with the O statement i made
- over AH&U's; if someone finds that the "obvious" generalisation doesn't
- fit my guess...)
-
- > Also you need quite
- > large integer before the fancier methods are faster than the elementary
- > algorithm.
-
- i grant that. it's up to the implementor whether to bother with a more
- complex method for his own uses. if you're thinking about general usage
- though, like a Lisp bignum package, the extra work may be appreciated.
-
- In <MARKT.93Jan7124834@wundt.harlqn.co.uk>, markt@harlqn.co.uk (Mark Tillotson) said:
- > I believe a tight implementation can start to win over straight long
- > division when the numbers get to be a few hundred digits long. When
- --------
- > the numbers get to be hundreds of millions of digits, it is the only
- > practical way!!
-
- (i hope he meant multiplication, not division)
- --
- Hume Smith Wenn ich des Tages nicht dreimal
- hume.smith@acadiau.ca mein Schaelchen Coffee trinken darf,
- emcoop@bnr.ca // so werd' ich ju zu meiner Qual
- \X/ wie ein verdorrtes Ziegenbraetchen.
-
-