Changeset 197d59d in mainline for uspace/lib/math/generic/pow.c
- Timestamp:
- 2021-06-18T16:06:03Z (3 years ago)
- Children:
- ca113cf
- Parents:
- f250c5a
- git-author:
- Maurizio Lombardi <mlombard@…> (2018-11-25 16:47:56)
- git-committer:
- Maurizio Lombardi <mlombard@…> (2021-06-18 16:06:03)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/math/generic/pow.c
rf250c5a r197d59d 136 136 if(k>20) { 137 137 j = ly>>(52-k); 138 if((j<<(52-k))== (int32_t)ly) yisint = 2-(j&1);138 if((j<<(52-k))==ly) yisint = 2-(j&1); 139 139 } else if(ly==0) { 140 140 j = iy>>(20-k); … … 148 148 if (iy==0x7ff00000) { /* y is +-inf */ 149 149 if(((ix-0x3ff00000)|lx)==0) 150 return one; /* (-1)**+-inf is NaN*/150 return one; /* (-1)**+-inf is 1 */ 151 151 else if (ix >= 0x3ff00000)/* (|x|>1)**+-inf = inf,0 */ 152 152 return (hy>=0)? y: zero; … … 157 157 if(hy<0) return one/x; else return x; 158 158 } 159 if(hy==0x40000000) return x*x; /* y is 2 */ 160 if(hy==0x40080000) return x*x*x; /* y is 3 */ 161 if(hy==0x40100000) { /* y is 4 */ 162 u = x*x; 163 return u*u; 164 } 165 if(hy==0x3fe00000) { /* y is 0.5 */ 159 if(hy==0x40000000) return x*x; /* y is 2 */ 160 if(hy==0x3fe00000) { /* y is 0.5 */ 166 161 if(hx>=0) /* x >= +0 */ 167 162 return sqrt(x); 168 163 } 169 164 } … … 314 309 if((j>>20)<=0) z = scalbn(z,n); /* subnormal output */ 315 310 else SET_HIGH_WORD(z,j); 316 317 311 return s*z; 318 312 }
Note:
See TracChangeset
for help on using the changeset viewer.