summaryrefslogtreecommitdiffstats
path: root/lib/libm/noieee_src/n_exp__E.c
diff options
context:
space:
mode:
authormartynas <martynas@openbsd.org>2008-07-17 15:36:28 +0000
committermartynas <martynas@openbsd.org>2008-07-17 15:36:28 +0000
commita93b996ba4666d2b81f8520a3028eccddf1c5222 (patch)
tree5fd322435710b6c313fa2d54a1a09f7ef5ded079 /lib/libm/noieee_src/n_exp__E.c
parentuse getaddrinfo/getnameinfo to parse ipv6 addresses instead of (diff)
downloadwireguard-openbsd-a93b996ba4666d2b81f8520a3028eccddf1c5222.tar.xz
wireguard-openbsd-a93b996ba4666d2b81f8520a3028eccddf1c5222.zip
properly raise inexact; ok millert@
Diffstat (limited to 'lib/libm/noieee_src/n_exp__E.c')
-rw-r--r--lib/libm/noieee_src/n_exp__E.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/libm/noieee_src/n_exp__E.c b/lib/libm/noieee_src/n_exp__E.c
index 039427219ae..9fd13ada83a 100644
--- a/lib/libm/noieee_src/n_exp__E.c
+++ b/lib/libm/noieee_src/n_exp__E.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: n_exp__E.c,v 1.6 2008/06/21 08:26:19 martynas Exp $ */
+/* $OpenBSD: n_exp__E.c,v 1.7 2008/07/17 15:36:28 martynas Exp $ */
/* $NetBSD: n_exp__E.c,v 1.1 1995/10/10 23:36:45 ragge Exp $ */
/*
* Copyright (c) 1985, 1993
@@ -129,7 +129,11 @@ __exp__E(double x, double c)
/* end of |x| > small */
else {
- if(x!=zero) one+small; /* raise the inexact flag */
- return(copysign(zero,x));
+ if(x != zero) {
+ if (one + small >= 1.0) /* raise the inexact flag */
+ return(copysign(zero,x));
+ }
+ else
+ return(copysign(zero,x));
}
}