Click here to Skip to main content
15,895,011 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: 2 not so simple questions Pin
Nemok27-Jul-04 11:37
Nemok27-Jul-04 11:37 
GeneralRe: 2 not so simple questions Pin
David Crow28-Jul-04 3:32
David Crow28-Jul-04 3:32 
GeneralList Contol Pin
sweep12326-Jul-04 5:57
sweep12326-Jul-04 5:57 
GeneralRe: List Contol Pin
palbano26-Jul-04 18:51
palbano26-Jul-04 18:51 
GeneralComparing Real Numbers Pin
jerry1211a26-Jul-04 5:10
jerry1211a26-Jul-04 5:10 
GeneralRe: Comparing Real Numbers Pin
Henry miller26-Jul-04 6:23
Henry miller26-Jul-04 6:23 
GeneralRe: Comparing Real Numbers Pin
PJ Arends26-Jul-04 6:26
professionalPJ Arends26-Jul-04 6:26 
GeneralRe: Comparing Real Numbers Pin
David Crow26-Jul-04 6:43
David Crow26-Jul-04 6:43 
jerry1211a wrote:
If the values are floats I believe they cant be compared due to rounding.

You are correct.

jerry1211a wrote:
Is there a way to make a comparison between to real values?

Yes. You'll need to decide the level of precision, however. For example:

double dVal1 = 1.245, dVal2 = 1.249;
if (fabs(dVal1 - dVal2) < 0.01) // note the 'f'
    ... // numbers match
else
    ... // numbers do not match
The number of decimal places in the constant must be equal to the number of decimal places being compared in the other two numbers.


"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen


GeneralDisplaying build times Pin
Chris Hills26-Jul-04 4:25
Chris Hills26-Jul-04 4:25 
GeneralRe: Displaying build times Pin
Tomasz Sowinski26-Jul-04 4:38
Tomasz Sowinski26-Jul-04 4:38 
GeneralRe: Displaying build times Pin
Chris Hills1-Aug-04 2:10
Chris Hills1-Aug-04 2:10 
GeneralDocument template problem Pin
dolph_loe26-Jul-04 3:19
dolph_loe26-Jul-04 3:19 
GeneralRe: Document template problem Pin
Tomasz Sowinski26-Jul-04 4:51
Tomasz Sowinski26-Jul-04 4:51 
GeneralRe: Document template problem Pin
dolph_loe28-Jul-04 10:51
dolph_loe28-Jul-04 10:51 
GeneralTerminating Process Pin
GTS202026-Jul-04 2:28
GTS202026-Jul-04 2:28 
GeneralRe: Terminating Process Pin
David Crow26-Jul-04 3:46
David Crow26-Jul-04 3:46 
GeneralRe: Terminating Process Pin
GTS202026-Jul-04 5:20
GTS202026-Jul-04 5:20 
GeneralRe: Terminating Process Pin
David Crow26-Jul-04 8:30
David Crow26-Jul-04 8:30 
GeneralGetting the HACCEL handle... Pin
0v3rloader26-Jul-04 2:03
0v3rloader26-Jul-04 2:03 
GeneralRe: Getting the HACCEL handle... Pin
Antony M Kancidrowski26-Jul-04 2:19
Antony M Kancidrowski26-Jul-04 2:19 
GeneralCString Problems Pin
#realJSOP26-Jul-04 0:54
mve#realJSOP26-Jul-04 0:54 
GeneralRe: CString Problems Pin
palbano26-Jul-04 7:33
palbano26-Jul-04 7:33 
Questionno copy constructor? Pin
feline_dracoform26-Jul-04 0:09
feline_dracoform26-Jul-04 0:09 
AnswerRe: no copy constructor? Pin
David Crow26-Jul-04 3:53
David Crow26-Jul-04 3:53 
GeneralRe: no copy constructor? Pin
feline_dracoform27-Jul-04 2:02
feline_dracoform27-Jul-04 2:02 

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.