//flex table opened by JP

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


jellyktb
02-10-2002, 02:17 AM
This is a duplicate of a post on VirtualDr High precision with Visual C++ 6.0 (http://discussions.virtualdr.com/Forum10/HTML/006119.html). It looks like this may be a more appropriate place for it so I'll give it a try.

I am hoping to find some way to get around the idiocy of Microsoft in this matter.

Here is my post:

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.

Any suggestions out there?

qball
02-12-2002, 08:43 PM
be written in C or C++ to run as a Windows application


I have no VB solution, but java will do this easily. Getting the result back into whatever needs it (VB) may be an issue...