DOSBox-X
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
src/mt32/freeverb/denormals.h
00001 // Macro for killing denormalled numbers
00002 //
00003 // Written by Jezar at Dreampoint, June 2000
00004 // http://www.dreampoint.co.uk
00005 // Based on IS_DENORMAL macro by Jon Watte
00006 // This code is public domain
00007 
00008 #ifndef _denormals_
00009 #define _denormals_
00010 
00011 static inline float undenormalise(float x) {
00012         union {
00013                 float f;
00014                 unsigned int i;
00015         } u;
00016         u.f = x;
00017         if ((u.i & 0x7f800000) == 0) {
00018                 return 0.0f;
00019         }
00020         return x;
00021 }
00022 
00023 #endif//_denormals_