C++ MAKEDOUBLE ??
-
Do you know if it is possible to create an 64-bit value (double) by concatenating two specified 32-bit values (long)?? The macro MAKELONG exists but MAKEDOUBLE, no...Apparently, it is not possible to make a << on a double?? Do you know a way to do it? Thanks, LX
-
Do you know if it is possible to create an 64-bit value (double) by concatenating two specified 32-bit values (long)?? The macro MAKELONG exists but MAKEDOUBLE, no...Apparently, it is not possible to make a << on a double?? Do you know a way to do it? Thanks, LX
What exactly do you want to do? You know that long and double are two different animals, don't you? One is integer type and another is floating point. This means that glueing together two longs doesn't produce one double. Tomasz Sowinski -- http://www.shooltz.com
-
What exactly do you want to do? You know that long and double are two different animals, don't you? One is integer type and another is floating point. This means that glueing together two longs doesn't produce one double. Tomasz Sowinski -- http://www.shooltz.com
Yes, it's right !!:-O What I want to do is based on STL : ------------------------------------------ typedef struct _MYSTRUCTURE { long lType; long lSubType; }MYSTRUCTURE; typedef std::vector lID; typedef std::map myMap; ------------------------------------------- But when I do a 'find.' on myMap, STL can't find my vector in searching on MYSTRUCTURE 'cause it can't compare : ... ---- MYSTRUCTURE myStructure; myStructure.lType = 10; myStructure.lSubType = 11; myMap::iterator it; it = m_mymap.find(myStructure); ---- So, I wanted to concatenated the 2 longs and using typedef std::map myMap; but, you're right : double and long are two differents animals... Do you see a solution ? LX
-
Yes, it's right !!:-O What I want to do is based on STL : ------------------------------------------ typedef struct _MYSTRUCTURE { long lType; long lSubType; }MYSTRUCTURE; typedef std::vector lID; typedef std::map myMap; ------------------------------------------- But when I do a 'find.' on myMap, STL can't find my vector in searching on MYSTRUCTURE 'cause it can't compare : ... ---- MYSTRUCTURE myStructure; myStructure.lType = 10; myStructure.lSubType = 11; myMap::iterator it; it = m_mymap.find(myStructure); ---- So, I wanted to concatenated the 2 longs and using typedef std::map myMap; but, you're right : double and long are two differents animals... Do you see a solution ? LX
Your code got scrambled - you didn't replace < and > with < and > Anyway, using std::pair to keep type and subtype together may be solution for your problem. Tomasz Sowinski -- http://www.shooltz.com
-
Your code got scrambled - you didn't replace < and > with < and > Anyway, using std::pair to keep type and subtype together may be solution for your problem. Tomasz Sowinski -- http://www.shooltz.com
-
Do you know if it is possible to create an 64-bit value (double) by concatenating two specified 32-bit values (long)?? The macro MAKELONG exists but MAKEDOUBLE, no...Apparently, it is not possible to make a << on a double?? Do you know a way to do it? Thanks, LX