From 76c7cd6fbd0c6ab87af8753a84c90a812001b951 Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 24 Nov 2013 14:16:24 +0100 Subject: [PATCH] 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) --- src/frontend/numparam/numparam.h | 3 --- src/frontend/numparam/xpressn.c | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/frontend/numparam/numparam.h b/src/frontend/numparam/numparam.h index 5994cb9ae..07890a0b4 100644 --- a/src/frontend/numparam/numparam.h +++ b/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 */ diff --git a/src/frontend/numparam/xpressn.c b/src/frontend/numparam/xpressn.c index d205c288c..3467d57c9 100644 --- a/src/frontend/numparam/xpressn.c +++ b/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: