Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » double equals nothing
double equals nothing [message #26910] Tue, 08 June 2010 22:30 Go to previous message
nixnixnix is currently offline  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

Quote:


ptr->pt = [, ]



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

 
Read Message
Read Message
Previous Topic: BUG: Serious problem with Core/CharSet
Next Topic: Thread::ShutdownThreads not safe
Goto Forum:
  


Current Time: Tue Apr 23 23:00:34 CEST 2024

Total time taken to generate the page: 0.07060 seconds