diff options
author | das <das@FreeBSD.org> | 2011-10-21 06:26:38 +0000 |
---|---|---|
committer | das <das@FreeBSD.org> | 2011-10-21 06:26:38 +0000 |
commit | e068faa86b2f941fee33afe19eb3b015e0cb9f61 (patch) | |
tree | efe324dcb8a65c88f3cfebddd083efe5239c4025 /lib/msun/src/s_expm1f.c | |
parent | 396066c48af8c4c5b0ae4854e92e6f1d29658134 (diff) | |
download | FreeBSD-src-e068faa86b2f941fee33afe19eb3b015e0cb9f61.zip FreeBSD-src-e068faa86b2f941fee33afe19eb3b015e0cb9f61.tar.gz |
Use STRICT_ASSIGN() to ensure that the compiler doesn't screw things
up by storing x in a wider type than it's supposed to.
Submitted by: bde
Diffstat (limited to 'lib/msun/src/s_expm1f.c')
-rw-r--r-- | lib/msun/src/s_expm1f.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/msun/src/s_expm1f.c b/lib/msun/src/s_expm1f.c index d7dd1b9..fb37494 100644 --- a/lib/msun/src/s_expm1f.c +++ b/lib/msun/src/s_expm1f.c @@ -16,6 +16,8 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include <float.h> + #include "math.h" #include "math_private.h" @@ -74,7 +76,7 @@ expm1f(float x) hi = x - t*ln2_hi; /* t*ln2_hi is exact here */ lo = t*ln2_lo; } - x = hi - lo; + STRICT_ASSIGN(float, x, hi - lo); c = (hi-x)-lo; } else if(hx < 0x33000000) { /* when |x|<2**-25, return x */ |