Extremely large double precision...?
Author Message
Extremely large double precision...?

Hey all,

I need help extending a number to more digits of precision than the built
in datatype(s) permit.  The long double, for example, can hold a number to
10^4932, but can only do 19 digits of precision

So, if a long double only provides a number like such:

12345678912345678910000000.0    (19 digits)

I need to be able to represent the entire number with all precision like
such:

12345678912345678912345678.0    (26 digits)

so that the precision is complete.  I also need to be able to do numbers
27+ digits

Thanks,

Fri, 19 Jan 2001 03:00:00 GMT
Extremely large double precision...?

Quote:
>Hey all,

>I need help extending a number to more digits of precision than the built
>in datatype(s) permit.  The long double, for example, can hold a number to
>10^4932, but can only do 19 digits of precision

>So, if a long double only provides a number like such:

>    12345678912345678910000000.0    (19 digits)

>I need to be able to represent the entire number with all precision like
>such:

>    12345678912345678912345678.0    (26 digits)

>so that the precision is complete.  I also need to be able to do numbers
>27+ digits

You need to look into an extended or arbitrary precision arithmetic
library. The Cephes library contains one:

http://www.netlib.org/cephes/index.html

From the docs:

"     This computer software library is a collection of more than
400 high quality mathematical routines for scientific and
engineering applications.   All are written entirely in C
language.  Many of the functions are supplied in six different
arithmetic precisions: 32 bit single (24-bit significand), 64 bit
IEEE double (53-bit), 64 bit DEC (56-bit), 80 or 96 bit IEEE long
double (64-bit), and extended precision formats having 144-bit
and 336-bit significands.  The extended precision arithmetic is
included with the function library."

Also go here:

http://monet.uwaterloo.ca/blitz/oon.html#libraries

and check out the "Multiprecision data types" section, which lists a
number of free arbitrary precision packages. Let me know if you find a
good one. :)

As for commercial offerings, I think Rogue Wave sells an extended
precision package aimed at financial users.

--
Doug Harrison

Sat, 20 Jan 2001 03:00:00 GMT
Extremely large double precision...?

Quote:
>I need help extending a number to more digits of precision than the built
>in datatype(s) permit.  The long double, for example, can hold a number to

This is only a layman's attempt at solving your problem but you could try
defining your own number type.  An example would be a structure as follows:

class MyNumberType {
long double LeftOfDecimal;
long double RightOfDecimal;

Quote:
};

Then overload any operators for use with this class.

Sat, 20 Jan 2001 03:00:00 GMT
Extremely large double precision...?

Quote:

>I need help extending a number to more digits of precision than the built
>in datatype(s) permit.  The long double, for example, can hold a number to
>10^4932, but can only do 19 digits of precision

What you really need is a BCD ("Binary coded decimal") library.
RogueWave, for one, sells such a class library (Money++).  Other venders do
as well.

--
Truth,
James [MVP]
http://www.NJTheater.Com       -and-
http://www.NJTheater.Com/JamesCurran

begin 666 James M. Curran.vcf

M4DLZ.SLQ."!*;VAN(%-T+"!3=6ET92 R0CM";&]O;69I96QD.TY*.S W,# S
M+34Q-#D-"DQ!0D5,.U=/4DL[14Y#3T1)3D<]455/5\$5\$+5!224Y404),13HQ
M."!*;VAN(%-T+"!3=6ET92 R0CTP1#TP04)L;V]M9FEE;&0L(\$Y*(# W,# S
M+34Q-#D-"E523#IH='1P.B\O=W=W+DY*5&AE871E<BYC;VTO2F%M97-#=7)R
M86X-"E523#IH='1P.B\O=W=W+DY*5&AE871E<BYC;VT-"D5-04E,.U!2148[
M24Y415).150Z2F%M97-#=7)R86Y 0V]M<'5397)V92YC;VT-"E)%5CHQ.3DX

`
end

Sun, 21 Jan 2001 03:00:00 GMT

 Page 1 of 1 [ 4 post ]

Relevant Pages