Click to See Complete Forum and Search --> : High precision in Visual C++ 6.0


jellyktb
02-11-2002, 05:11 PM
I am attempting to write a program that deals with mortgage loan data. As such I need to use a data format that supports very high precision.

Turbo Pascal version 7.0 has a data format called "extended" which is the internal format used by the NPU.

However, I am trying to use Visual C++ version 6.0 since I want the program to be written in C or C++ to run as a Windows application. The C and C++ languages theoretically support this format with the "long double" data type. However, the help documentation for Visual C++ version 6.0 states the following: Previous 16-bit versions of Microsoft C/C++ and Microsoft Visual C++ supported the long double, 80-bit precision data type. In Win32 programming, however, the long double data type maps to the double, 64-bit precision data type. The Microsoft run- time library provides long double
versions of the math functions only for backward compatability. The long double
function prototypes are identical to the prototypes for their double counterparts, except that the long double data type replaces the double data type. The long double versions of these functions should not be used in new code.

-----------

Table 2.3 Fundamental Types of the C++ Language [relevant entry only]

Category Type Contents
------------------------------------------
Floating long Type long double is a floating type that is
double(1) equal to type double.
------------------------------------------

(1) The representation of long double and double is identical. However,Long double and double are separate types.


Using the "double" type yields incorrect results. http://www.sharkyforums.com/ubb/mad.gif

Any suggestions out there?

------------------
Do right 'till the stars fall