What I\'m trying to do is to convert a double to hex string and then back to double.
The following code does conversion double-to-hex string.
char *
For MFC, convert double to CString :)
CString MFCClass::DoubleToCString(double d, int beforKomma)
{
char a[17]="0123456789ABCDEF";
CString str = _T("");
double dInt=0,dPunkt=0;
bool is_otr=0;
if (d<0) {is_otr=1; d=-d;}
dPunkt = modf(d, &dInt);
//целая часть
long ld = (long)dInt;
long mask = 0xf;
int it;
while(ld>0)
{
it = ld&mask;
ld = ld>>4;
str.Insert(0,a[it]);
};
// дробная часть
//если целая часть 0:
if (str.GetLength()==0) str += _T("0");
str += _T(".");
for (int i=0; i
-345.86783907228863 -> "-159.DE2" (beforKomma=3)