numparam, use `trunc()'

This commit is contained in:
rlar 2016-04-30 19:20:49 +02:00
parent 31ca73a6f0
commit 15e8fab975
3 changed files with 2 additions and 13 deletions

View File

@ -41,6 +41,5 @@ int yes_or_no(void);
int freadstr(FILE *f, SPICE_DSTRINGPTR dstr_p);
double np_round(double d); // sjb to avoid clash with round() in math.h
double np_trunc(double x); // sjb to avoid clash with trunc() in math.h
double absf(double x); /* abs */
long absi(long i);

View File

@ -479,13 +479,3 @@ np_round(double r)
{
return floor(r + 0.5);
}
double
np_trunc(double r)
{
if (r >= 0.0)
return floor(r);
else
return ceil(r);
}

View File

@ -843,11 +843,11 @@ operate(char op, double x, double y)
x = z;
break;
case '%': /* % */
t = np_trunc(x / y);
t = trunc(x / y);
x = x - y * t;
break;
case '\\': /* / */
x = np_trunc(fabs(x / y));
x = trunc(fabs(x / y));
break;
}