1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

Fix pow(3) and powf(3) regression in earlier undefined behavior fix.

This commit is contained in:
Jonas 'Sortie' Termansen 2020-12-06 13:04:23 +01:00
parent 7139de4a53
commit fa11548c56
2 changed files with 2 additions and 2 deletions

View file

@ -296,7 +296,7 @@ __ieee754_pow(double x, double y)
r = (z*t1)/(t1-two)-(w+z*w);
z = one-(r-z);
GET_HIGH_WORD(j,z);
j = (int32_t)((uint32_t)j + ((uint32_t)u<<20));
j = (int32_t)((uint32_t)j + ((uint32_t)n<<20));
if((j>>20)<=0) z = scalbn(z,n); /* subnormal output */
else SET_HIGH_WORD(z,j);
return s*z;

View file

@ -240,7 +240,7 @@ __ieee754_powf(float x, float y)
r = (z*t1)/(t1-two)-(w+z*w);
z = one-(r-z);
GET_FLOAT_WORD(j,z);
j = (int32_t)((uint32_t)j + ((uint32_t)u<<23));
j = (int32_t)((uint32_t)j + ((uint32_t)n<<23));
if((j>>23)<=0) z = scalbnf(z,n); /* subnormal output */
else SET_FLOAT_WORD(z,j);
return s*z;