Click here to Skip to main content
15,918,243 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralStatus Bar (continued) Pin
LighthouseJ13-Jan-05 12:33
LighthouseJ13-Jan-05 12:33 
GeneralRe: Status Bar (continued) Pin
KaЯl14-Jan-05 2:16
KaЯl14-Jan-05 2:16 
GeneralScrollbars in a Dialog Pin
dlarkin7713-Jan-05 9:52
dlarkin7713-Jan-05 9:52 
GeneralRe: Scrollbars in a Dialog Pin
Shog913-Jan-05 11:46
sitebuilderShog913-Jan-05 11:46 
GeneralRe: Scrollbars in a Dialog Pin
dlarkin7714-Jan-05 7:25
dlarkin7714-Jan-05 7:25 
GeneralVC++6 + VS SP6 = COMPUTATION BUG!! Pin
Fred D.13-Jan-05 6:23
Fred D.13-Jan-05 6:23 
GeneralRe: VC++6 + VS SP6 = COMPUTATION BUG!! Pin
PJ Arends13-Jan-05 6:46
professionalPJ Arends13-Jan-05 6:46 
GeneralRe: VC++6 + VS SP6 = COMPUTATION BUG!! Pin
Antony M Kancidrowski13-Jan-05 6:52
Antony M Kancidrowski13-Jan-05 6:52 
Fred D. wrote:
Wonder if there is any fix for that one

I doubt it. What you have stumbled across is inevitable with floating point arithmetic.

You need to decide what precision you want and round up to that precision after your calculation. You can then show the floating point number to the precision required.

e.g.

double res = 25.5/1000 + 0.0005;

for your example.

Ant.

I'm hard, yet soft.
I'm coloured, yet clear.
I'm fruity and sweet.
I'm jelly, what am I? Muse on it further, I shall return!
- David Walliams (Little Britain)

GeneralRe: VC++6 + VS SP6 = COMPUTATION BUG!! Pin
Fred D.13-Jan-05 7:33
Fred D.13-Jan-05 7:33 
GeneralRe: VC++6 + VS SP6 = COMPUTATION BUG!! Pin
Antony M Kancidrowski13-Jan-05 12:56
Antony M Kancidrowski13-Jan-05 12:56 
QuestionHow to Run a executable file using c++ program Pin
Aqueel13-Jan-05 3:56
Aqueel13-Jan-05 3:56 
AnswerRe: How to Run a executable file using c++ program Pin
Budric B.13-Jan-05 4:13
Budric B.13-Jan-05 4:13 
GeneralRe: How to Run a executable file using c++ program Pin
toxcct13-Jan-05 22:42
toxcct13-Jan-05 22:42 
AnswerRe: How to Run a executable file using c++ program Pin
Blake Miller13-Jan-05 4:13
Blake Miller13-Jan-05 4:13 
AnswerRe: How to Run a executable file using c++ program Pin
David Crow13-Jan-05 5:57
David Crow13-Jan-05 5:57 
AnswerRe: How to Run a executable file using c++ program Pin
Michael Dunn13-Jan-05 7:14
sitebuilderMichael Dunn13-Jan-05 7:14 
Generalhooking menu item in active X Pin
mansour_ahmadian13-Jan-05 2:43
mansour_ahmadian13-Jan-05 2:43 
GeneralRe: hooking menu item in active X Pin
Roger Allen13-Jan-05 3:14
Roger Allen13-Jan-05 3:14 
QuestionAuto-update of my app? Pin
Hoornet9313-Jan-05 1:57
Hoornet9313-Jan-05 1:57 
AnswerRe: Auto-update of my app? Pin
ThatsAlok13-Jan-05 2:57
ThatsAlok13-Jan-05 2:57 
GeneralRe: Auto-update of my app? Pin
Hoornet9313-Jan-05 3:13
Hoornet9313-Jan-05 3:13 
GeneralRe: Auto-update of my app? Pin
ThatsAlok13-Jan-05 3:27
ThatsAlok13-Jan-05 3:27 
GeneralRe: Auto-update of my app? Pin
Hoornet9314-Jan-05 1:19
Hoornet9314-Jan-05 1:19 
GeneralRe: Auto-update of my app? Pin
ThatsAlok14-Jan-05 2:07
ThatsAlok14-Jan-05 2:07 
GeneralRe: Auto-update of my app? Pin
Hoornet9314-Jan-05 2:37
Hoornet9314-Jan-05 2:37 

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.