Browse Source

xpressn.c, fix semantics of `int(x)' and remove dangerous macros

int(x) most probably shall be trunc(x) instead of floor(x)
  note trunc(x) was #defined beeing floor(x)
  note ln(x) was #defined beeing log(x)
pre-master-46
rlar 13 years ago
parent
commit
76c7cd6fbd
  1. 3
      src/frontend/numparam/numparam.h
  2. 6
      src/frontend/numparam/xpressn.c

3
src/frontend/numparam/numparam.h

@ -9,9 +9,6 @@
/***** numparam internals ********/
#define ln(x) log(x)
#define trunc(x) floor(x)
typedef enum {Nodekey = '#'} _nNodekey; /* Introduces node symbol */
typedef enum {Intro = '&'} _nIntro; /* Introduces preprocessor tokens */
typedef enum {Comment = '*'} _nComment; /* Spice Comment lines */

6
src/frontend/numparam/xpressn.c

@ -124,8 +124,8 @@ mathfunction(int f, double z, double x)
case 5:
y = exp(x);
break;
case 6:
y = ln(x);
case 6: /* ln(x) */
y = log(x);
break;
case 7:
y = atan(x);
@ -145,7 +145,7 @@ mathfunction(int f, double z, double x)
case 12:
y = MIN(x, z);
break;
case 13:
case 13: /* int(x) */
y = trunc(x);
break;
case 14:

Loading…
Cancel
Save