Home » U++ Library support » U++ Core » double equals nothing
double equals nothing [message #26910] |
Tue, 08 June 2010 22:30 |
nixnixnix
Messages: 415 Registered: February 2007 Location: Kelowna, British Columbia
|
Senior Member |
|
|
Hi,
I have a function that looks like this
double CUtils::LittleEndianDouble(char* p)
{
double* pD;
char cBuf[9];
memcpy(cBuf,p,8);
cBuf[8] = 0;
pD = (double*)cBuf;
return *pD;
}
and I have come across a file which causes the output to become undefined. For instance, when I go to DUMP the result of initialising a Pointf object with two such doubles, I get
and when I look at it in the debugger the value is also blank and gets copied as blank. If I can just detect this then I can deal with it. I have tried checking whether it equals NULL or IsNull but neither catch it.
I would have thought that any string cast to double would give some sort of recognisable result. Surely that is part of the strength of C++ ?
Nick
EDIT: not sure why it doesn't display but in fact the value was equal to FFFFFFFFFFFFEFFF which converts to -1.7976931348623157e+308 which I admit is a very silly number. It would still be good if this value showed in the debugger but I don't need it fixed now.
[Updated on: Tue, 08 June 2010 23:01] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Wed May 15 05:39:59 CEST 2024
Total time taken to generate the page: 0.02114 seconds
|