diff --git a/src/include/missing_math.h b/src/include/missing_math.h index 52e72ceb9..cfa9ed42f 100644 --- a/src/include/missing_math.h +++ b/src/include/missing_math.h @@ -19,9 +19,11 @@ extern double logb(double); #endif #ifndef HAVE_SCALB -# ifndef HAVE_SCALBN -extern double scalb(double, int); +extern double scalb(double, double); #endif + +#ifndef HAVE_SCALBN +extern double scalbn(double, int); #endif #ifndef HAVE_ISNAN diff --git a/src/maths/misc/scalb.c b/src/maths/misc/scalb.c index bd29ab1ee..60c8f82b8 100644 --- a/src/maths/misc/scalb.c +++ b/src/maths/misc/scalb.c @@ -4,13 +4,10 @@ Copyright 1991 Regents of the University of California. All rights reserved. #include "ngspice.h" -#ifndef HAVE_SCALB -# ifdef HAVE_SCALBN -# define scalb scalbn -# else /* Chris Inbody */ +#ifndef HAVE_SCALBN double -scalb(double x, int n) +scalbn(double x, int n) { double y, z = 1.0, k = 2.0; @@ -28,14 +25,24 @@ scalb(double x, int n) return x * z; } -# endif /* HAVE_SCALBN */ -#else /* HAVE_SCALB */ -# ifndef HAVE_SCALBN -extern scalb(double x, long n); -scalbn(double x, int n) + +#else /* HAVE_SCALBN */ + +int Dummy_Symbol_1; + +#endif /* HAVE_SCALBN */ + + +#ifndef HAVE_SCALB + +double +scalb(double x, double n) { - return scalb(x, (long)n); + return scalbn(x, (int) n); } -# endif -int Dummy_Symbol_1; + +#else /* HAVE_SCALB */ + +int Dummy_Symbol_2; + #endif /* HAVE_SCALB */ diff --git a/src/maths/sparse/spsmp.c b/src/maths/sparse/spsmp.c index 1e0e21883..f93acf349 100644 --- a/src/maths/sparse/spsmp.c +++ b/src/maths/sparse/spsmp.c @@ -101,6 +101,10 @@ #include #include "spdefs.h" #include + +#if defined (_MSC_VER) +extern double scalbn(double, int); +#endif static void LoadGmin(SMPmatrix *eMatrix, double Gmin);