include/ngspice/cm.h, xspice, introduce NAN for visual studio

This commit is contained in:
h_vogt 2015-12-22 00:02:45 +01:00 committed by rlar
parent 8e50275345
commit a18ac9c474
2 changed files with 13 additions and 2 deletions

View File

@ -45,5 +45,16 @@ NON-STANDARD FEATURES
#include "ngspice/cmproto.h"
#include "ngspice/mifcmdat.h"
#if defined (_MSC_VER)
#ifndef NAN
static const __int64 global_nan = 0x7ff8000000000000i64;
#define NAN (*(const double *) &global_nan)
#endif
#endif
#if !defined(NAN)
#define NAN (0.0/0.0)
#endif
#endif

View File

@ -294,8 +294,8 @@ cm_core(ARGS)
/*** must determine position progressively & then ***/
/*** calculate required output. ***/
dout_din = 0.0 / 0.0;
B_out = 0.0 / 0.0;
dout_din = NAN;
B_out = NAN;
for (i = 1; i < size; i++)
if (H_input < (H[i].rvalue + H[i+1].rvalue) / 2.0) {