This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: mingw-64 80 bit precision for doubles works
- From: navin p <navinp1281 at gmail dot com>
- To: sisyphus1 at optusnet dot com dot au
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 18 Dec 2014 09:23:41 +0530
- Subject: Re: mingw-64 80 bit precision for doubles works
- Authentication-results: sourceware.org; auth=none
- References: <CAKVd3pXWMsdpxTOddvDKijxmxurD6mCgGZqvBk230NZi9XXShA at mail dot gmail dot com> <6769A69DEAC447E2A7D7607A39F1B56C at OwnerPC311012>
On Thu, Dec 18, 2014 at 4:12 AM, <sisyphus1@optusnet.com.au> wrote:
> -----Original Message----- From: navin p
>
>> How can gcc/mingw-64 build x64 executables with double precision set to
>> 80 bits?
>
>
> You'll need to define __USE_MINGW_ANSI_STDIO to 1 at the beginning.
>
> /***************************/
> #define __USE_MINGW_ANSI_STDIO 1
> #include <stdio.h>
>
> int main(void) {
> long double x = 1.18L;
> printf("%La\n%.18Lg\n", x, x);
> return 0;
> }
>
> /***************************/
>
> Outputs (with both 32-bit and 64-bit mingw builds of gcc):
>
> 0x9.70a3d70a3d70a3dp-3
> 1.18
>
> You can, of course, build with -D__USE_MINGW_ANSI_STDIO on the command line
> if you don't want to define the symbol in the script.
>
> Cheers,
> Rob
Sorry if it was not clear. Well i know that mingw can build double in
extended precision mode for x64 executables on windows but visual
studio 2010 can't .
Do we need to set some registers so that even Visual Studio 2010 can build it ?
-
Navin