From cb5c057c87240a9534f8e0d9b7ff2560082f6218 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sat, 11 Apr 2015 00:35:07 +0000 Subject: math: fix pow(+-0,-inf) not to raise divbyzero flag this reverts the commit f29fea00b5bc72d4b8abccba2bb1e312684d1fce which was based on a bug in C99 and POSIX and did not match IEEE-754 http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1515.pdf --- src/math/powf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/math/powf.c') diff --git a/src/math/powf.c b/src/math/powf.c index 59baf6f3..427c8965 100644 --- a/src/math/powf.c +++ b/src/math/powf.c @@ -90,7 +90,7 @@ float powf(float x, float y) return 1.0f; else if (ix > 0x3f800000) /* (|x|>1)**+-inf = inf,0 */ return hy >= 0 ? y : 0.0f; - else if (ix != 0) /* (|x|<1)**+-inf = 0,inf if x!=0 */ + else /* (|x|<1)**+-inf = 0,inf */ return hy >= 0 ? 0.0f: -y; } if (iy == 0x3f800000) /* y is +-1 */ -- cgit 1.4.1