what I am looking for is a set of routines (e.g., a library),
written in portable pre-1999 C, whose source is available,
that, using 32-bit maths, implements at least the five basic
integer operations (+ - * / %) for 64-bit integers, and which
ideally has both a "signed" and "unsigned" version.
please note I said using 32-bit maths. so NO <long long>,
NO <__int64>, NO <i64>, none of that stuff! the compilers
(plural) in question do not have 64-bit integers.
ideally C, albeit C++ could be Ok, but NO assembly.
implementations in other languages (e.g., Java) which could
be used as a model and reference for a C version would be Ok.
ideally a BSD-ish license, albeit (L)GPL, CPL, or so on
should be Ok.
ideally, the "64-bit integers" would be stored as something
like an array[] or <struct> of two 32-bit integers. storing
as ASCII string, or BCD, or so on would be problematical.
I do not need an arbitrary precision package (such as GNUs
BigNum), nor rationals, nor fixed point, etc., just signed
and unsigned 64-bit integers. and please note I have _not_
mentioned (time) efficiency, albeit space (size) could be
a concern. but must be mathematically sound, and ideally
also has a comprehensive Test Suite.
Google™ has not (yet) been of much help here. (I suppose
the GCC support library might have something like this?)
any ideas? pointers?
cheers!
-blf-
--
«How many surrealists does it take to | Brian Foster Montpellier,
change a lightbulb? Three. One calms | blf at utvinternet.ie FRANCE
the warthog, and two fill the bathtub | Stop E$$o (ExxonMobile)!
with brightly-colored machine tools.» | http://www.stopesso.com
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!