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

C / C++ / MFC

 
AnswerRe: Double value precision Pin
Chandrasekharan P6-Dec-11 19:27
Chandrasekharan P6-Dec-11 19:27 
GeneralRe: Double value precision Pin
mutpan6-Dec-11 19:35
mutpan6-Dec-11 19:35 
GeneralRe: Double value precision Pin
Chandrasekharan P6-Dec-11 20:33
Chandrasekharan P6-Dec-11 20:33 
AnswerRe: Double value precision Pin
CPallini6-Dec-11 22:13
mveCPallini6-Dec-11 22:13 
GeneralRe: Double value precision Pin
Albert Holguin7-Dec-11 3:24
professionalAlbert Holguin7-Dec-11 3:24 
AnswerRe: Double value precision Pin
tssutha036-Dec-11 22:30
tssutha036-Dec-11 22:30 
AnswerRe: Double value precision Pin
Chuck O'Toole7-Dec-11 5:03
Chuck O'Toole7-Dec-11 5:03 
AnswerRe: Double value precision Pin
JackDingler9-Dec-11 9:30
JackDingler9-Dec-11 9:30 
Everyone is doing a good job explaining this.

Doubles only provide approximations of decimal numbers.

As another commentator pointed out, there are mathematical difficulties in converting from binary to decimal and back again.

The difference in your output, and the number you expect, is close enough for science.

But for other systems, like money, not good quite enough.

To get the results you want you might roll your own number class, or use one of the many public ones that are available.

Maybe this one?
CLN - Class Library for Numbers
AnswerRe: Double value precision Pin
Chuck O'Toole9-Dec-11 10:38
Chuck O'Toole9-Dec-11 10:38 
GeneralRe: Double value precision Pin
JackDingler9-Dec-11 10:42
JackDingler9-Dec-11 10:42 
AnswerRe: Double value precision Pin
Chuck O'Toole9-Dec-11 16:52
Chuck O'Toole9-Dec-11 16:52 
QuestionAccess ODBC issue/question in MFC Application CDatabase Class Pin
MacRaider46-Dec-11 9:06
MacRaider46-Dec-11 9:06 
QuestionRe: Access ODBC issue/question in MFC Application CDatabase Class Pin
David Crow7-Dec-11 6:17
David Crow7-Dec-11 6:17 
AnswerRe: Access ODBC issue/question in MFC Application CDatabase Class Pin
MacRaider47-Dec-11 6:47
MacRaider47-Dec-11 6:47 
AnswerRe: Access ODBC issue/question in MFC Application CDatabase Class Pin
MacRaider47-Dec-11 7:27
MacRaider47-Dec-11 7:27 
AnswerRe: Access ODBC issue/question in MFC Application CDatabase Class Pin
jkirkerx7-Dec-11 8:38
professionaljkirkerx7-Dec-11 8:38 
GeneralRe: Access ODBC issue/question in MFC Application CDatabase Class Pin
MacRaider47-Dec-11 9:24
MacRaider47-Dec-11 9:24 
GeneralRe: Access ODBC issue/question in MFC Application CDatabase Class Pin
jkirkerx7-Dec-11 10:49
professionaljkirkerx7-Dec-11 10:49 
GeneralRe: Access ODBC issue/question in MFC Application CDatabase Class Pin
MacRaider48-Dec-11 1:09
MacRaider48-Dec-11 1:09 
GeneralRe: Access ODBC issue/question in MFC Application CDatabase Class Pin
jkirkerx9-Dec-11 11:29
professionaljkirkerx9-Dec-11 11:29 
GeneralRe: Access ODBC issue/question in MFC Application CDatabase Class Pin
MacRaider412-Dec-11 1:32
MacRaider412-Dec-11 1:32 
GeneralRe: Access ODBC issue/question in MFC Application CDatabase Class Pin
jkirkerx12-Dec-11 4:20
professionaljkirkerx12-Dec-11 4:20 
QuestionTextOut/DrawText is too slow Pin
Joe Smith IX6-Dec-11 6:32
Joe Smith IX6-Dec-11 6:32 
AnswerRe: TextOut/DrawText is too slow Pin
Chris Losinger6-Dec-11 8:45
professionalChris Losinger6-Dec-11 8:45 
GeneralRe: TextOut/DrawText is too slow Pin
Albert Holguin6-Dec-11 14:34
professionalAlbert Holguin6-Dec-11 14:34 

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.