Click here to Skip to main content
15,887,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Add .c file Pin
Maximilien18-Aug-11 4:48
Maximilien18-Aug-11 4:48 
GeneralRe: Add .c file Pin
john563218-Aug-11 4:56
john563218-Aug-11 4:56 
GeneralRe: Add .c file Pin
Richard MacCutchan18-Aug-11 5:23
mveRichard MacCutchan18-Aug-11 5:23 
GeneralRe: Add .c file Pin
Maximilien18-Aug-11 5:26
Maximilien18-Aug-11 5:26 
GeneralRe: Add .c file Pin
«_Superman_»18-Aug-11 5:38
professional«_Superman_»18-Aug-11 5:38 
QuestionRe: Add .c file Pin
David Crow18-Aug-11 4:49
David Crow18-Aug-11 4:49 
AnswerRe: Add .c file Pin
JohnNawrocki23-Aug-11 4:40
JohnNawrocki23-Aug-11 4:40 
QuestionSolved: Floating point rounding question Pin
Leif Goodwin17-Aug-11 22:39
Leif Goodwin17-Aug-11 22:39 
NB: As indicated in a reply the issue has been solved. The DirectX module was changing the floating point precision.

A colleague is calling the constructor of a class which takes two doubles as arguments. Each argument he passes is the sum of two doubles:

CGridPoint( a + b, c + d)

The class object stores the two values internally. When he views the result he sees that the values have been rounded to 1 decimal place.

The values are not so large that this would be expected. Here are example:

a = 44.445472717
b = 724631.800000000
a + b = 724676.250000000

In other words he passes in 44.445472717 + 724631.800000000 as the first argument to the constructor and the result is stored internally and is seen to be 724676.250000000.

Does anyone know the cause of this rounding?

BTW he uses VS2008. This works in VS2010.
AnswerRe: Floating point rounding question Pin
Richard MacCutchan17-Aug-11 22:48
mveRichard MacCutchan17-Aug-11 22:48 
GeneralRe: Floating point rounding question Pin
Leif Goodwin18-Aug-11 0:03
Leif Goodwin18-Aug-11 0:03 
GeneralRe: Floating point rounding question Pin
Richard MacCutchan18-Aug-11 1:15
mveRichard MacCutchan18-Aug-11 1:15 
GeneralRe: Floating point rounding question Pin
Leif Goodwin18-Aug-11 2:00
Leif Goodwin18-Aug-11 2:00 
AnswerRe: Floating point rounding question Pin
BobJanova18-Aug-11 1:35
BobJanova18-Aug-11 1:35 
AnswerRe: Floating point rounding question Pin
Peter_in_278018-Aug-11 1:55
professionalPeter_in_278018-Aug-11 1:55 
SuggestionWhen extending IE,How to get the binary data of a downloaded file? Pin
xinkmt17-Aug-11 15:16
xinkmt17-Aug-11 15:16 
GeneralRe: When extending IE,How to get the binary data of a downloaded file? Pin
xrg_soft@163.com17-Aug-11 18:28
xrg_soft@163.com17-Aug-11 18:28 
QuestionCommon Controls Issue Pin
Tracy Software17-Aug-11 2:12
Tracy Software17-Aug-11 2:12 
AnswerRe: Common Controls Issue Pin
Code-o-mat17-Aug-11 3:55
Code-o-mat17-Aug-11 3:55 
GeneralRe: Common Controls Issue Pin
Tracy Software17-Aug-11 22:59
Tracy Software17-Aug-11 22:59 
GeneralRe: Common Controls Issue Pin
Code-o-mat18-Aug-11 1:59
Code-o-mat18-Aug-11 1:59 
AnswerRe: Common Controls Issue Pin
David Crow17-Aug-11 4:25
David Crow17-Aug-11 4:25 
AnswerRe: Common Controls Issue Pin
Richard MacCutchan17-Aug-11 6:26
mveRichard MacCutchan17-Aug-11 6:26 
GeneralRe: Common Controls Issue Pin
Tracy Software17-Aug-11 21:39
Tracy Software17-Aug-11 21:39 
GeneralRe: Common Controls Issue Pin
Richard MacCutchan17-Aug-11 22:36
mveRichard MacCutchan17-Aug-11 22:36 
SuggestionRe: Common Controls Issue Pin
enhzflep17-Aug-11 22:47
enhzflep17-Aug-11 22:47 

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.