summaryrefslogtreecommitdiff
path: root/lib/libm/noieee_src/n_floor.c
diff options
context:
space:
mode:
authorMartynas Venckus <martynas@cvs.openbsd.org>2008-06-12 15:58:00 +0000
committerMartynas Venckus <martynas@cvs.openbsd.org>2008-06-12 15:58:00 +0000
commit1e72660127a56fdf02b5b43293d426076aff795f (patch)
treeb848a12220058f38f7dba2fd1b67cf6517b74714 /lib/libm/noieee_src/n_floor.c
parentbccef4d20904e9126be50edde929a5d97eb7fa9f (diff)
- no need for ifdef dance (21), we have isnan, finite for vax
- TEST_FMOD doesn't belong here, remove - remove ifdef _ANSI_SOURCE and assume it's default ok millert@
Diffstat (limited to 'lib/libm/noieee_src/n_floor.c')
-rw-r--r--lib/libm/noieee_src/n_floor.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/lib/libm/noieee_src/n_floor.c b/lib/libm/noieee_src/n_floor.c
index 563a93679d9..c9b7f34546a 100644
--- a/lib/libm/noieee_src/n_floor.c
+++ b/lib/libm/noieee_src/n_floor.c
@@ -55,11 +55,7 @@ double x;
{
volatile double y;
- if (
-#if !defined(__vax__)&&!defined(tahoe)
- x != x || /* NaN */
-#endif /* !defined(__vax__)&&!defined(tahoe) */
- x >= L) /* already an even integer */
+ if (isnan(x) || x >= L) /* already an even integer */
return x;
else if (x < (double)0)
return -ceil(-x);
@@ -76,11 +72,7 @@ double x;
{
volatile double y;
- if (
-#if !defined(__vax__)&&!defined(tahoe)
- x != x || /* NaN */
-#endif /* !defined(__vax__)&&!defined(tahoe) */
- x >= L) /* already an even integer */
+ if (isnan(x) || x >= L) /* already an even integer */
return x;
else if (x < (double)0)
return -floor(-x);
@@ -121,12 +113,12 @@ double x;
volatile double t;
const double one = 1.0;
-#if !defined(__vax__)&&!defined(tahoe)
- if (x != x) /* NaN */
+ if (isnan(x))
return (x);
-#endif /* !defined(__vax__)&&!defined(tahoe) */
- if (copysign(x,one) >= L) /* already an integer */
- return (x);
+
+ if (copysign(x, one) >= L) /* already an integer */
+ return (x);
+
s = copysign(L,x);
t = x + s; /* x+s rounded to integer */
return (t - s);