Skip site navigation (1) Skip section navigation (2)

Re: Building with Visual C++

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Building with Visual C++
Date: 2006-04-24 07:40:23
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCEA352E5@algol.sollentuna.se (view raw or flat)
Thread:
Lists: pgsql-patches
> > *) Change where NaN is generated. Using 0.0/0.0 doesn't 
> work in VC++ 
> > because it detects it as a divide-by-zero at the compile stage.
> 
> If they're going to be that anally uncooperative, why don't 
> they have the required-by-C99-spec macro for NAN?  Or at 
> least some well-defined way to generate a NaN?

They do have one way that's documented on MSDN, which is:
unsigned long nan[2]={0xffffffff, 0x7fffffff};
double g = *( double* )nan;

I thought that was even uglier ;-), but I can change it to use that on
win32 if you prefer it?

//Magnus

Responses

pgsql-patches by date

Next:From: Tom LaneDate: 2006-04-24 15:51:34
Subject: Re: Building with Visual C++
Previous:From: Magnus HaganderDate: 2006-04-24 07:38:10
Subject: Re: Building with Visual C++

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group