Browse Source

add a non-zero fudge factor to zero function argument

pre-master-46
Holger Vogt 8 years ago
parent
commit
af351eab5f
  1. 5
      src/spicelib/parser/ptfuncs.c

5
src/spicelib/parser/ptfuncs.c

@ -14,6 +14,7 @@ Author: 1987 Wayne A. Christopher, U. C. Berkeley CAD Group
#include "ngspice/ifsim.h"
#include "ngspice/inpptree.h"
#include "inpxx.h"
#include "ngspice/compatmode.h"
/* XXX These should be in math.h */
@ -82,6 +83,10 @@ PTpower(double arg1, double arg2)
double
PTpwr(double arg1, double arg2)
{
/* if PSPICE device is evaluated */
if (arg1 == 0.0 && arg2 < 0.0 && inp_compat_mode == COMPATMODE_PS)
arg1 += PTfudge_factor;
if (arg1 < 0.0)
return (-pow(-arg1, arg2));
else

Loading…
Cancel
Save