Click here to Skip to main content
15,892,537 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Why does my dialog controls disappear ? Pin
Cedric Moonen3-Feb-09 0:56
Cedric Moonen3-Feb-09 0:56 
QuestionWhat is complier actually doing here ? Pin
ComplexLifeForm2-Feb-09 23:56
ComplexLifeForm2-Feb-09 23:56 
AnswerRe: What is complier actually doing here ? Pin
Cedric Moonen3-Feb-09 0:04
Cedric Moonen3-Feb-09 0:04 
AnswerRe: What is complier actually doing here ? Pin
CPallini3-Feb-09 0:05
mveCPallini3-Feb-09 0:05 
AnswerRe: What is complier actually doing here ? Pin
«_Superman_»3-Feb-09 1:10
professional«_Superman_»3-Feb-09 1:10 
Questionfloating point precision issue Pin
Sarath C2-Feb-09 23:42
Sarath C2-Feb-09 23:42 
AnswerRe: floating point precision issue Pin
Cedric Moonen2-Feb-09 23:53
Cedric Moonen2-Feb-09 23:53 
GeneralRe: floating point precision issue [modified] Pin
Sarath C3-Feb-09 0:38
Sarath C3-Feb-09 0:38 
OK

try this code. then things will be more clear.

float f = 0.2f 0.6f;
 f -= 0.2f;
 f -= 0.2f;
 f -= 0.2f;

 if( f == 0.0f ) // this condition will be failed
 {
     // f == 0;
 }


In this case, after subtracting 0.2 three times, the value should reach to 0.0f. But it's fails. because of the trailing additional digits in the floating point representation. The same case exists for double type as well.

-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin

modified on Tuesday, February 3, 2009 6:59 AM

GeneralRe: floating point precision issue Pin
Cedric Moonen3-Feb-09 0:48
Cedric Moonen3-Feb-09 0:48 
GeneralRe: floating point precision issue Pin
Sarath C3-Feb-09 0:55
Sarath C3-Feb-09 0:55 
GeneralRe: floating point precision issue Pin
Stuart Dootson3-Feb-09 1:06
professionalStuart Dootson3-Feb-09 1:06 
AnswerRe: floating point precision issue Pin
CPallini3-Feb-09 0:00
mveCPallini3-Feb-09 0:00 
AnswerRe: floating point precision issue Pin
Stuart Dootson3-Feb-09 0:38
professionalStuart Dootson3-Feb-09 0:38 
AnswerRe: floating point precision issue Pin
David Crow3-Feb-09 4:47
David Crow3-Feb-09 4:47 
QuestionCompile time error for 'string.h' Pin
Supriya Tonape2-Feb-09 23:33
Supriya Tonape2-Feb-09 23:33 
AnswerRe: Compile time error for 'string.h' Pin
Cedric Moonen2-Feb-09 23:37
Cedric Moonen2-Feb-09 23:37 
GeneralRe: Compile time error for 'string.h' Pin
Supriya Tonape2-Feb-09 23:44
Supriya Tonape2-Feb-09 23:44 
AnswerRe: Compile time error for 'string.h' Pin
prasad_som3-Feb-09 3:27
prasad_som3-Feb-09 3:27 
QuestionRe: Compile time error for 'string.h' Pin
David Crow3-Feb-09 4:50
David Crow3-Feb-09 4:50 
AnswerRe: Compile time error for 'string.h' Pin
Supriya Tonape12-Feb-09 0:33
Supriya Tonape12-Feb-09 0:33 
QuestionUnicode Strings Pin
user30342-Feb-09 23:31
user30342-Feb-09 23:31 
AnswerRe: Unicode Strings Pin
Sarath C2-Feb-09 23:50
Sarath C2-Feb-09 23:50 
GeneralRe: Unicode Strings Pin
Supriya Tonape3-Feb-09 1:00
Supriya Tonape3-Feb-09 1:00 
QuestionHow to append text in word document caption? Pin
SNI2-Feb-09 21:48
SNI2-Feb-09 21:48 
AnswerRe: How to append text in word document caption? Pin
Stuart Dootson2-Feb-09 22:14
professionalStuart Dootson2-Feb-09 22:14 

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.