long double support on 80x86 C++ Win32 compilers

Bruce Dawson <comments@cygnus-software.com>
10 Aug 1998 10:23:16 -0400

          From comp.compilers

Related articles
long double support on 80x86 C++ Win32 compilers comments@cygnus-software.com (Bruce Dawson) (1998-08-10)
Re: long double support on 80x86 C++ Win32 compilers ak@muc.de (Andi Kleen) (1998-08-10)
Re: long double support on 80x86 C++ Win32 compilers michael_ross@ccm.intel.com (Michael Ross) (1998-08-10)
Re: long double support on 80x86 C++ Win32 compilers mfinney@lynchburg.net (1998-08-13)
Re: long double support on 80x86 C++ Win32 compilers comments@cygnus-software.com (Bruce Dawson) (1998-08-16)
| List of all articles for this month |
From: Bruce Dawson <comments@cygnus-software.com>
Newsgroups: comp.compilers
Date: 10 Aug 1998 10:23:16 -0400
Organization: Cygnus Software
Keywords: arithmetic, practice, question, comment

VisualC++ has long ago ditched support for the long double (80-bit)
floating point type, but I have a number of projects that would
benefit substantially from being able to compile C++ code (with
templates) with long double precision.


I understand that Borland C++ Builder 3.0 supports long double, and
I'm interested to find what other compilers do.


The following (C - sorry) test program can be used to see how large a
floating point number fits into a compiler's long double. An eight
byte double overflows around 1e350, a ten byte double overflows far
beyond that.


#include <stdio.h>


int main(int argc, char *argv[])
{
long double x = 123456789;
for (int i = 0; i < 10; i++)
{
x *= x;
printf("x = %g\n", x);
}
return 0;
}


--
Bruce Dawson, Cygnus Software Author of Fractal eXtreme for Win32
http://www.cygnus-software.com/
comments@cygnus-software.com
[gcc 2.x stores 80 bits but prints garbage because %g expects 64 bit rather
than 80 bit floats. -John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.