History

avutil/softfloat: use ldexp(), fixes undefined shift

Michael Niedermayer committed 9 years ago

Commit 79aa2ff1 parent c4be2881 file · +1 −2Browse files

Unified · Split

libavutil/softfloat.h+1−2
@@ -50,8 +50,7 @@ static const SoftFloat FLOAT_0999999 = { 0x3FFFFBCE, 0}; · 49 unmodified lines
50 */50 */
51static inline av_const double av_sf2double(SoftFloat v) {51static inline av_const double av_sf2double(SoftFloat v) {
52 v.exp -= ONE_BITS +1;52 v.exp -= ONE_BITS +1;
53 if(v.exp > 0) return (double)v.mant * (double)(1 << v.exp);53 return ldexp(v.mant, v.exp);
54 else return (double)v.mant / (double)(1 << (-v.exp));
55}54}
56 55
57static av_const SoftFloat av_normalize_sf(SoftFloat a){56static av_const SoftFloat av_normalize_sf(SoftFloat a){

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t