Denormal DOUBLE variables, macro

References : Posted by Jon Watte
Notes :
Use this macro if you want to find denormal numbers and you're using doubles...
Code :
#if PLATFORM_IS_BIG_ENDIAN
#define INDEX 0
#else
#define INDEX 1
#endif
inline bool is_denormal( double const & d ) {
  assert( sizeof( d ) == 2*sizeof( int ) );
  int l = ((int *)&d)[INDEX];
  return (l&0x7fe00000) != 0;
}

Comments
from : dont-email-me
comment : put the #if inside the function itself