home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / cplus / 11722 < prev    next >
Encoding:
Text File  |  1992-07-29  |  1.8 KB  |  41 lines

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