Click here to Skip to main content
15,914,360 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Binary inputs Pin
David Crow18-Apr-06 9:37
David Crow18-Apr-06 9:37 
AnswerRe: Binary inputs Pin
Stephen Hewitt18-Apr-06 15:34
Stephen Hewitt18-Apr-06 15:34 
QuestionConverting numbers Pin
Waldermort18-Apr-06 8:49
Waldermort18-Apr-06 8:49 
AnswerRe: Converting numbers Pin
Rage18-Apr-06 9:06
professionalRage18-Apr-06 9:06 
GeneralRe: Converting numbers Pin
Waldermort18-Apr-06 9:10
Waldermort18-Apr-06 9:10 
GeneralRe: Converting numbers Pin
Rage18-Apr-06 9:14
professionalRage18-Apr-06 9:14 
GeneralRe: Converting numbers Pin
Waldermort18-Apr-06 9:30
Waldermort18-Apr-06 9:30 
GeneralRe: Converting numbers Pin
John M. Drescher18-Apr-06 10:10
John M. Drescher18-Apr-06 10:10 
Here is a very non optimal way (the shift can be replaced with a copy):

Take the 32bit # and mask off the lowest two bits. Then store it in a 64 bit integer __int64. Then left shift the integer by 32 bits. Then declare a double* and give it the address of the integer. Then declare a double and set it to the value that the double* (above) points to. Now if bit 0 of the first # is 1 divide the double by 100...


int code; //Set this to your 32 bit code
__int64 temp=(code & 0xFFFFFFFD); //Mask the lowest two bits of the code
temp << 32; // Shift the code 32 bits to the left
double* pFloat = (double *)temp; 
double ans = *pFloat;
if (code & 1) ans /= 100.0;

John

-- modified at 16:20 Tuesday 18th April, 2006
GeneralRe: Converting numbers Pin
Waldermort18-Apr-06 10:23
Waldermort18-Apr-06 10:23 
GeneralRe: Converting numbers Pin
John M. Drescher18-Apr-06 10:35
John M. Drescher18-Apr-06 10:35 
GeneralRe: Converting numbers Pin
Waldermort18-Apr-06 10:40
Waldermort18-Apr-06 10:40 
GeneralRe: Converting numbers Pin
John M. Drescher18-Apr-06 10:42
John M. Drescher18-Apr-06 10:42 
GeneralRe: Converting numbers Pin
Rage18-Apr-06 22:18
professionalRage18-Apr-06 22:18 
GeneralRe: Converting numbers Pin
Stephen Hewitt18-Apr-06 14:34
Stephen Hewitt18-Apr-06 14:34 
AnswerRe: Converting numbers Pin
John M. Drescher18-Apr-06 9:53
John M. Drescher18-Apr-06 9:53 
GeneralRe: Converting numbers Pin
Waldermort18-Apr-06 20:36
Waldermort18-Apr-06 20:36 
QuestionToolbar Pin
Rage18-Apr-06 8:47
professionalRage18-Apr-06 8:47 
AnswerRe: Toolbar Pin
Rage18-Apr-06 9:22
professionalRage18-Apr-06 9:22 
QuestionChecked menu ??? Pin
Surivevoli18-Apr-06 8:34
Surivevoli18-Apr-06 8:34 
AnswerRe: Checked menu ??? Pin
includeh1018-Apr-06 8:51
includeh1018-Apr-06 8:51 
GeneralRe: Checked menu ??? Pin
Surivevoli18-Apr-06 8:58
Surivevoli18-Apr-06 8:58 
GeneralRe: Checked menu ??? Pin
Surivevoli18-Apr-06 9:53
Surivevoli18-Apr-06 9:53 
AnswerRe: Checked menu ??? Pin
Michael Dunn18-Apr-06 17:24
sitebuilderMichael Dunn18-Apr-06 17:24 
QuestionHow to debug directshow filters? Pin
yongwpi18-Apr-06 7:15
yongwpi18-Apr-06 7:15 
AnswerRe: How to debug directshow filters? Pin
SebKa21-Apr-06 1:04
SebKa21-Apr-06 1:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.