Click here to Skip to main content
15,913,937 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to convert real to binary Pin
Aljaz11114-Oct-09 3:09
Aljaz11114-Oct-09 3:09 
AnswerRe: How to convert real to binary Pin
Iain Clarke, Warrior Programmer14-Oct-09 3:22
Iain Clarke, Warrior Programmer14-Oct-09 3:22 
AnswerRe: How to convert real to binary Pin
Cedric Moonen14-Oct-09 4:18
Cedric Moonen14-Oct-09 4:18 
AnswerRe: How to convert real to binary Pin
CPallini14-Oct-09 5:05
mveCPallini14-Oct-09 5:05 
GeneralRe: How to convert real to binary Pin
Aljaz11114-Oct-09 6:26
Aljaz11114-Oct-09 6:26 
GeneralRe: How to convert real to binary Pin
Ozer Karaagac14-Oct-09 15:54
professionalOzer Karaagac14-Oct-09 15:54 
GeneralRe: How to convert real to binary Pin
Luc Pattyn14-Oct-09 16:18
sitebuilderLuc Pattyn14-Oct-09 16:18 
GeneralRe: How to convert real to binary Pin
Patcher3214-Oct-09 17:59
Patcher3214-Oct-09 17:59 
Is it -16.735 or -16,735?

-16.735 = -10000.1011110000101000111101011100001010001111010111
-16,735 = -100000101011111

The general procedure is to do integer and fraction part separately.

For integer part N :
1. If N is not zero, divide N by 2
2. If remainder is 1 write down 1, if its 0 write down 0
3. N = N/2 - remainder. Go back to Step 1.
Finally, write the 0 and 1 in reverse order.

Example, N = 40
1. 40/2 = 20. Remainder = 0. Write 0
2. 20/2 = 10. Remainder = 0. Write 0
3. 10/2 = 5. Remainder = 0. Write 0
4. 5/2 = 2 + 1/2. Remainder = 1/2. Write 1
5. 2/2 = 1. Remainder = 0. Write 0
6. 1/2 = 0 + 1/2. Remainder = 1/2. Write 1
Threfore, 40 = 101000

For fraction part F,
1. If F is not zero, Multiply F by 2.
2. If result is greater than or equal to 1, write down 1. F = (F * 2) - 1
3. If result is not greater than 1, write down 1. F = (F * 2)
4. If F > 0 go back to step 1.

Example, F = 0.25
1. 0.25 * 2 = 0.5. Write down 0
2. 0.5 * 2 = 1. Write down 1
Thus 0.25 = 0.01
QuestionOpen an associated file using doubleclick while application is running Pin
Erik14-Oct-09 2:22
Erik14-Oct-09 2:22 
QuestionRe: Open an associated file using doubleclick while application is running Pin
David Crow14-Oct-09 2:27
David Crow14-Oct-09 2:27 
AnswerRe: Open an associated file using doubleclick while application is running Pin
Erik14-Oct-09 18:17
Erik14-Oct-09 18:17 
GeneralRe: Open an associated file using doubleclick while application is running Pin
David Crow15-Oct-09 3:07
David Crow15-Oct-09 3:07 
AnswerRe: Open an associated file using doubleclick while application is running Pin
Iain Clarke, Warrior Programmer14-Oct-09 3:31
Iain Clarke, Warrior Programmer14-Oct-09 3:31 
QuestionDisconnection of LAN cable abruptly Pin
nvshree8714-Oct-09 1:49
nvshree8714-Oct-09 1:49 
AnswerRe: Disconnection of LAN cable abruptly Pin
Moak14-Oct-09 9:56
Moak14-Oct-09 9:56 
QuestionChanging Default Icon in MFC Pin
Hari_1614-Oct-09 1:31
Hari_1614-Oct-09 1:31 
AnswerRe: Changing Default Icon in MFC Pin
Game-point14-Oct-09 1:41
Game-point14-Oct-09 1:41 
GeneralRe: Changing Default Icon in MFC Pin
Hari_1614-Oct-09 1:54
Hari_1614-Oct-09 1:54 
AnswerRe: Changing Default Icon in MFC Pin
CPallini14-Oct-09 1:54
mveCPallini14-Oct-09 1:54 
GeneralRe: Changing Default Icon in MFC Pin
Hari_1614-Oct-09 1:59
Hari_1614-Oct-09 1:59 
GeneralRe: Changing Default Icon in MFC Pin
CPallini14-Oct-09 2:12
mveCPallini14-Oct-09 2:12 
GeneralRe: Changing Default Icon in MFC Pin
Hari_1614-Oct-09 2:08
Hari_1614-Oct-09 2:08 
QuestionNetServerDiskEnum Example Pin
Abinash Mohanty14-Oct-09 1:29
Abinash Mohanty14-Oct-09 1:29 
AnswerRe: NetServerDiskEnum Example Pin
Richard MacCutchan14-Oct-09 2:08
mveRichard MacCutchan14-Oct-09 2:08 
GeneralRe: NetServerDiskEnum Example Pin
Abinash Mohanty14-Oct-09 18:07
Abinash Mohanty14-Oct-09 18:07 

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.