Click here to Skip to main content
15,920,687 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: string functions in C Pin
David Crow10-Nov-06 3:59
David Crow10-Nov-06 3:59 
AnswerRe: string functions in C Pin
Mark Salsbery10-Nov-06 5:15
Mark Salsbery10-Nov-06 5:15 
GeneralRe: string functions in C Pin
David Crow10-Nov-06 5:26
David Crow10-Nov-06 5:26 
GeneralRe: string functions in C Pin
Mark Salsbery10-Nov-06 6:25
Mark Salsbery10-Nov-06 6:25 
AnswerRe: string functions in C Pin
Bram van Kampen11-Nov-06 16:05
Bram van Kampen11-Nov-06 16:05 
QuestionRe: string functions in C Pin
David Crow12-Nov-06 15:37
David Crow12-Nov-06 15:37 
AnswerRe: string functions in C Pin
Bram van Kampen14-Nov-06 14:24
Bram van Kampen14-Nov-06 14:24 
QuestionPrecision in doubles Pin
Oliver1239-Nov-06 11:56
Oliver1239-Nov-06 11:56 
I suspect everyone has run unti this, but I just ran into it.

double d1 = 1;

When I look at d1 in the debugger, it will show 1.0000001342, or something similar. Now, that is close to 1, but it's not the same as 1.

d1 - 1 is then equal to .0000001342.
And .0000001342 isn't zero.

Suggestions as to how to handle this? How do I get 1.0000000000 rather than 1.0000001342?

I know I can use an int for 1, but the same thing occurs with:

double d2 = 2.354
debugger shows d2 as 2.3540000154.

Thanks
AnswerRe: Precision in doubles Pin
Mark Salsbery9-Nov-06 12:29
Mark Salsbery9-Nov-06 12:29 
AnswerRe: Precision in doubles Pin
AJR_UK9-Nov-06 12:49
AJR_UK9-Nov-06 12:49 
GeneralRe: Precision in doubles Pin
Mark Salsbery9-Nov-06 12:54
Mark Salsbery9-Nov-06 12:54 
GeneralRe: Precision in doubles Pin
AJR_UK9-Nov-06 14:19
AJR_UK9-Nov-06 14:19 
GeneralRe: Precision in doubles Pin
Mark Salsbery9-Nov-06 15:06
Mark Salsbery9-Nov-06 15:06 
AnswerRe: Precision in doubles Pin
CPallini13-Nov-06 7:29
mveCPallini13-Nov-06 7:29 
QuestionUse of typename in VC6 Pin
rakesh.patel9-Nov-06 11:54
rakesh.patel9-Nov-06 11:54 
AnswerRe: Use of typename in VC6 Pin
Christian Graus9-Nov-06 13:08
protectorChristian Graus9-Nov-06 13:08 
Questionpleeeeez i need help for reading&writing files/C++ Pin
top7ob9-Nov-06 10:53
top7ob9-Nov-06 10:53 
AnswerRe: pleeeeez i need help for reading&writing files/C++ Pin
Mark Salsbery9-Nov-06 11:36
Mark Salsbery9-Nov-06 11:36 
AnswerRe: pleeeeez i need help for reading&writing files/C++ Pin
Christian Graus9-Nov-06 13:09
protectorChristian Graus9-Nov-06 13:09 
QuestionIcon Pin
BlitzPackage9-Nov-06 10:30
BlitzPackage9-Nov-06 10:30 
AnswerRe: Icon Pin
Mark Salsbery9-Nov-06 11:39
Mark Salsbery9-Nov-06 11:39 
GeneralRe: Icon Pin
BlitzPackage9-Nov-06 13:01
BlitzPackage9-Nov-06 13:01 
GeneralRe: Icon Pin
Mark Salsbery9-Nov-06 13:39
Mark Salsbery9-Nov-06 13:39 
GeneralRe: Icon Pin
BlitzPackage9-Nov-06 13:43
BlitzPackage9-Nov-06 13:43 
GeneralRe: Icon Pin
Mark Salsbery9-Nov-06 13:54
Mark Salsbery9-Nov-06 13:54 

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.