]> git.sesse.net Git - vlc/blob - modules/audio_filter/spatializer/denormals.h
Fixed undenormalise for 64 bits.
[vlc] / modules / audio_filter / spatializer / denormals.h
1 // Macro for killing denormalled numbers
2 //
3 // Written by Jezar at Dreampoint, June 2000
4 // http://www.dreampoint.co.uk
5 // Based on IS_DENORMAL macro by Jon Watte
6 // This code is public domain
7
8 #ifndef _denormals_
9 #define _denormals_
10
11 #include <stdint.h>
12
13 static inline float undenormalise( float f )
14 {
15     union { float f; uint32_t u; } data;
16     data.f = f;
17     if( (data.u & 0x7f800000) == 0 )
18         return 0.0;
19     return f;
20 }
21
22 #endif//_denormals_
23