#include "cwCommon.h" #include "cwLog.h" #include "cwCommonImpl.h" #include "cwUtility.h" void cw::printHex( const void* buf, unsigned bufByteN, bool asciiFl ) { const unsigned char* data = static_cast(buf); const unsigned colN = 8; unsigned ci = 0; for(unsigned i=0; i all elements zero */ { exp = (short)(std::log(val)/std::log(2.0) + 16383.0); val *= pow(2.0, 31.0+16383.0-(double)exp); mant1 =((unsigned)val); val -= ((double)mant1); val *= pow(2.0, 32.0); mant0 =((double)val); } *p++ = ((sign<<7)|(exp>>8)); *p++ = (u_char)(0xFF & exp); *p++ = (u_char)(0xFF & (mant1>>24)); *p++ = (u_char)(0xFF & (mant1>>16)); *p++ = (u_char)(0xFF & (mant1>> 8)); *p++ = (u_char)(0xFF & (mant1)); *p++ = (u_char)(0xFF & (mant0>>24)); *p++ = (u_char)(0xFF & (mant0>>16)); *p++ = (u_char)(0xFF & (mant0>> 8)); *p++ = (u_char)(0xFF & (mant0)); }