History

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

Michael Niedermayer committed 9 years ago

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

Showing the changes to libavutil/softfloat.h (1 of 1 file). Show all

Unified · Split

libavutil/softfloat.h+1−2
@@ -50,8 +50,7 @@ static const SoftFloat FLOAT_0999999 = { 0x3FFFFBCE, 0}; · 49 unmodified lines
5050 */
5151 static inline av_const double av_sf2double(SoftFloat v) {
5252 v.exp -= ONE_BITS +1;
53− if(v.exp > 0) return (double)v.mant * (double)(1 << v.exp);
54− else return (double)v.mant / (double)(1 << (-v.exp));
53+ return ldexp(v.mant, v.exp);
5554 }
5655
5756 static 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