mirror of
git://git.musl-libc.org/musl
synced 2025-03-06 20:48:29 +01:00
math: fix pow(0,-inf) to raise divbyzero flag
This commit is contained in:
parent
1b77b9072f
commit
f29fea00b5
2 changed files with 2 additions and 2 deletions
|
@ -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 /* (|x|<1)**+-inf = 0,inf */
|
||||
else if ((ix|lx) != 0) /* (|x|<1)**+-inf = 0,inf if x!=0 */
|
||||
return hy >= 0 ? 0.0 : -y;
|
||||
}
|
||||
if (iy == 0x3ff00000) /* y is +-1 */
|
||||
|
|
|
@ -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 /* (|x|<1)**+-inf = 0,inf */
|
||||
else if (ix != 0) /* (|x|<1)**+-inf = 0,inf if x!=0 */
|
||||
return hy >= 0 ? 0.0f: -y;
|
||||
}
|
||||
if (iy == 0x3f800000) /* y is +-1 */
|
||||
|
|
Loading…
Add table
Reference in a new issue