Browse Source

hopefull better scalb handling

pre-master-46
dwarning 18 years ago
parent
commit
b32feaa18d
  1. 6
      src/include/missing_math.h
  2. 33
      src/maths/misc/scalb.c
  3. 4
      src/maths/sparse/spsmp.c

6
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

33
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 */

4
src/maths/sparse/spsmp.c

@ -101,6 +101,10 @@
#include <spmatrix.h>
#include "spdefs.h"
#include <smpdefs.h>
#if defined (_MSC_VER)
extern double scalbn(double, int);
#endif
static void LoadGmin(SMPmatrix *eMatrix, double Gmin);

Loading…
Cancel
Save