Class RWMultiPrecisionInt<n>
The private class
RWMultiPrecisionInt<n> provides a very large number of bits of precision for representing decimals. By replacing the
<n> in
RWMultiPrecisionInt<n> with an integer from 1 to 16, you can specify up to 16 *32, or 512 bits of precision. For example, the following declaration creates a number that will have 5 *32 or 160 bits of precision:
RWDecimal<RWMultiPrecisionInt<5> > myDecimal
RWMultiPrecisionInt<n> has been specialized for
n =1, since this case would use only one integer to represent a value, and you would be better off simply using an
int. When
n= 1, a type
double stores the integer value.
The speed of computation changes depend upon the number of bits used for precision. This means that a computation that uses class
RWDecimal<RWMultiPrecisionInt<1> > is faster than the same computation using
RWDecimal<RWMultiPrecisionInt<16> >.