home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnewsm!cbnewsk!pegasus!hansen
- From: hansen@pegasus.att.com (Tony L. Hansen)
- Subject: Re: Efficient 64-bit integer arithmetic
- Organization: AT&T
- Date: Wed, 29 Jul 1992 15:17:17 GMT
- Message-ID: <1992Jul29.151717.6485@cbnewsk.cb.att.com>
- Summary: See The C++ Answer Book
- Keywords: 64-bit integers
- References: <711997458snx@trmphrst.demon.co.uk> <1992Jul25.071552.1@vax1.umkc.edu>
- Sender: hansen@cbnewsk.cb.att.com (tony.l.hansen)
- Lines: 27
-
- In article <711997458snx@trmphrst.demon.co.uk>, nikki@trmphrst.demon.co.uk (Nikki Locke) writes:
- > I need to implement efficient 64-bit signed integer arithmetic in C++ (or C)
- > on a machine with a 32-bit long (actually, 60 significant bits + sign
- > would do fine).
- >
- > I need addition, subtraction, multiplication, division, remainder, and
- > efficient multiply and divide by 10 (for conversion to/from strings).
- >
- > I have looked at the bignum package, which implements arbitrary precision,
- > but I feel the extra constraint of having only 60 significant bits should
- > enable a much more efficient implementation to be possible.
- >
- > Does anyone know of any such code available for anonymous ftp ? Or have
- > any suggestions ?
-
- See classes LINT and arbint (sections 6.10 and 6.11) from The C++ Answer
- Book (Hansen, 1990, Addison-Wesley). It has everything you're asking for and
- the code is available via ftp from research.att.com (login as netlib, use
- your login id as a password, and cd to "c++/answerbook"), or via email
- server (send mail which says "send 6.10 from c++/answerbook" to
- netlib@research.att.com). The algorithms used are based on Knuth's
- algorithms.
-
- Tony Hansen
- hansen@pegasus.att.com, tony@attmail.com
- att!pegasus!hansen, attmail!tony
-
-