From c1bd74f982865e0ce93a9ee9cd3ff553c24ba6df Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 24 May 2014 12:53:18 +0200 Subject: [PATCH] mystring.c, drop auxiliary implementations of np_round() and np_trunc() --- src/frontend/numparam/mystring.c | 47 -------------------------------- 1 file changed, 47 deletions(-) diff --git a/src/frontend/numparam/mystring.c b/src/frontend/numparam/mystring.c index c8ee2960a..aad579fa6 100644 --- a/src/frontend/numparam/mystring.c +++ b/src/frontend/numparam/mystring.c @@ -599,51 +599,6 @@ spos_(char *sub, const char *s) } -#ifndef HAVE_LIBM - -long -np_round(double x) -/* using , it would be simpler: floor(x+0.5), see below */ -{ - double u; - long z; - int n; -// Str (40, s); - SPICE_DSTRING s; - - spice_dstring_init(&s); - u = 2e9; - - if (x > u) - x = u; - else if (x < -u) - x = -u; - - n = sprintf(s, "%-12.0f", x); - s[n] = 0; - sscanf(s, "%ld", &z); - - return z; -} - - -long -np_trunc(double x) -{ - long n = np_round(x); - - if ((n > x) && (x >= 0.0)) - n--; - else if ((n < x) && (x < 0.0)) - n++; - - return n; -} - - -#else /* use floor() and ceil() */ - - long np_round(double r) { @@ -659,5 +614,3 @@ np_trunc(double r) else return (long) ceil(r); } - -#endif