Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151144272
D22354.id64291.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D22354.id64291.diff
View Options
Index: lib/msun/src/e_hypot.c
===================================================================
--- lib/msun/src/e_hypot.c
+++ lib/msun/src/e_hypot.c
@@ -118,10 +118,8 @@
w = sqrt(t1*y1-(w*(-w)-(t1*y2+t2*b)));
}
if(k!=0) {
- u_int32_t high;
- t1 = 1.0;
- GET_HIGH_WORD(high,t1);
- SET_HIGH_WORD(t1,high+(k<<20));
+ t1 = 0.0;
+ SET_HIGH_WORD(t1,(1023+k)<<20);
return t1*w;
} else return w;
}
Index: lib/msun/src/e_hypotf.c
===================================================================
--- lib/msun/src/e_hypotf.c
+++ lib/msun/src/e_hypotf.c
@@ -77,7 +77,7 @@
w = __ieee754_sqrtf(t1*y1-(w*(-w)-(t1*y2+t2*b)));
}
if(k!=0) {
- SET_FLOAT_WORD(t1,0x3f800000+(k<<23));
+ SET_FLOAT_WORD(t1,(127+k)<<23);
return t1*w;
} else return w;
}
Index: lib/msun/src/e_hypotl.c
===================================================================
--- lib/msun/src/e_hypotl.c
+++ lib/msun/src/e_hypotl.c
@@ -115,10 +115,8 @@
w = sqrtl(t1*y1-(w*(-w)-(t1*y2+t2*b)));
}
if(k!=0) {
- u_int32_t high;
- t1 = 1.0;
- GET_HIGH_WORD(high,t1);
- SET_HIGH_WORD(t1,high+DESW(k));
+ t1 = 0;
+ SET_HIGH_WORD(t1,ESW(k)); /* t1=2^k */
return t1*w;
} else return w;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 7, 9:42 AM (1 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31023894
Default Alt Text
D22354.id64291.diff (1 KB)
Attached To
Mode
D22354: The fdlibm hypot() implementations shouldn't potentially left-shift negative numbers (invoking undefined behavior)
Attached
Detach File
Event Timeline
Log In to Comment