VC の NaN は、
xvalues.c で実体が、
ymath.h でexternが宣言されている。
_CRTIMP2 const _Dconst _Hugeval = {INIT(_DMAX << _DOFF)};
_CRTIMP2 const _Dconst _Inf = {INIT(_DMAX << _DOFF)};
_CRTIMP2 const _Dconst _Nan = {INIT((_DMAX << _DOFF) | (1 << (_DOFF - 1)))};
_CRTIMP2 const _Dconst _Snan = {INIT2(_DMAX << _DOFF, 1)};
_CRTIMP2 const _Dconst _Rteps = {INIT((_DBIAS - NBITS / 2) << _DOFF)};
_Nan._Double や _Snan._Double でdouble の値として使える。
C++では、
#include <limits>
をしてから、
std::numeric_limits::quiet_NaN();
とかで利用できる。