diff --git a/src/math/pow.c b/src/math/pow.c index 82f684bdb0e363c6846d0f7dde445cf4b5818618..b66f632d8eea9fce118c087677c755f391c6df85 100644 --- a/src/math/pow.c +++ b/src/math/pow.c @@ -143,7 +143,7 @@ double pow(double x, double y) return 1.0; else if (ix >= 0x3ff00000) /* (|x|>1)**+-inf = inf,0 */ return hy >= 0 ? y : 0.0; - else if ((ix|lx) != 0) /* (|x|<1)**+-inf = 0,inf if x!=0 */ + else /* (|x|<1)**+-inf = 0,inf */ return hy >= 0 ? 0.0 : -y; } if (iy == 0x3ff00000) { /* y is +-1 */ diff --git a/src/math/powf.c b/src/math/powf.c index 59baf6f3809cf0b9dfa9d6d55442c86a41e058fd..427c8965b9e8e78bca69660427a4e313087c3e0a 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 */ diff --git a/src/math/powl.c b/src/math/powl.c index a765706d9b34c4121a5d62750f158681ce39be58..5b6da07b2efcce53795ec80da4a787208a2cb733 100644 --- a/src/math/powl.c +++ b/src/math/powl.c @@ -227,7 +227,7 @@ long double powl(long double x, long double y) if (y <= -LDBL_MAX) { if (x > 1.0 || x < -1.0) return 0.0; - if (x != 0.0) + if (x != 0.0 || y == -INFINITY) return INFINITY; } if (x >= LDBL_MAX) {