Running VC++ 6 under Win2K on i386.
I would like to assign a (compile-time) constant that resolves to a
quiet NaN (of type double)
I can assign a quiet NaN to a *variable* (of type const double, say)
by eg.:
const double qnan = fmod(1.0,0.0);
but - for efficiency reasons - what I really want is a (compile-time)
constant:
#define QNAN ???
Now I have established that (on my system at least) the type __int64
is the same size as a double and that a quiet NaN corresponds to an
__int64 with a value of -2251799813685248. However, the "obvious":
#define QNAN -2251799813685248i64
will not work, since an assignment eg.:
double x = QNAN;
will cause the QNAN to be *cast* to type double, so that x will have
the value -2251799813685248.0
Is there a way to "turn off" automatic casting, so that an assignation
as above simply copies byte-for-byte?
Any ideas much appreciated,
--
Lionel B