Help! INT longer than LONG

In article

Quote:

> HI!

> I need to do calculations using numbers longer than LONG. They must be

> accurate so float won't do. Is there a way of doing this?

Since you desire to have numbers with the same ilk as 'long', I assume

that you can use integers. Given this constraint, sometimes 'double'

numbers may fit the bill. For whole (integer) numbers, double numbers are

fully accurate. Using IEEE numbers, they have at least 50 bits of

accuracy, which may be enough in your case. As long as you don't try to

excede 50 bits of a whole number you should be safe.

The assumption is that long's in your case are 32 bits (which is common,

but not universal). The increased accuracy is one of the reasons that the

result of 'difftime' (a standard function) is expressed as a 'double'.

The errors in floating point come with numbers that are not exact when

expressed in floating point. If you stick to integers, they work quite

well. Most of the time it is a waste, since integer arithmetic is much

quicker.

--

Tom Watson