Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: What is the difference between CClientDC and CDC? Pin
PJ Arends28-Dec-03 16:46
professionalPJ Arends28-Dec-03 16:46 
QuestionHow to permanent fix the dialog as maximize Pin
siew hoon28-Dec-03 15:51
siew hoon28-Dec-03 15:51 
GeneralRe: Updating a Progressbar while the App is doing hard work Pin
PJ Arends28-Dec-03 15:57
professionalPJ Arends28-Dec-03 15:57 
General\device\harddiskvolume1\windows\.. Pin
pranavamhari28-Dec-03 14:43
pranavamhari28-Dec-03 14:43 
GeneralGetting path of dll within that dll Pin
Kuniva28-Dec-03 14:30
Kuniva28-Dec-03 14:30 
GeneralRe: Getting path of dll within that dll Pin
Garth J Lancaster28-Dec-03 15:07
professionalGarth J Lancaster28-Dec-03 15:07 
GeneralRe: Getting path of dll within that dll Pin
PJ Arends28-Dec-03 15:08
professionalPJ Arends28-Dec-03 15:08 
GeneralProblem with double Pin
User 58385228-Dec-03 13:47
User 58385228-Dec-03 13:47 
Hello,
I have the following simple code and I cant understand the results I am seeing

Note. This is a big hack in an old peice of code. It would not be like this if I had my way Frown | :(

void SomeFn(void)
{
//these are not hard coded they come from another API in string form
CString result = CalcMargin("0.7033", "0.7000");
}

CString CalcMargin(LPCTSTR exeRate, LPCTSTR rate)
{
double dExeRate, dRate, dMargin;

dExeRate = atof(exeRate);
dRate = atof(rate);

dMargin = dExeRate - dRate;

result.Format("%f", dMargin);

return result;
}


The returned value is "0.003300" and I wondered why i see the trailing zeros. It turnes out that the result of the subtraction is 0.0033000000000001

Can anyone tell me why?
Thanks
GeneralRe: Problem with double Pin
kjessee28-Dec-03 14:04
kjessee28-Dec-03 14:04 
GeneralRe: Problem with double Pin
Michael Dunn28-Dec-03 17:58
sitebuilderMichael Dunn28-Dec-03 17:58 
GeneralRe: Problem with double Pin
User 58385228-Dec-03 18:12
User 58385228-Dec-03 18:12 
GeneralRe: Problem with double Pin
PJ Arends28-Dec-03 18:43
professionalPJ Arends28-Dec-03 18:43 
GeneralRe: Problem with double Pin
User 58385229-Dec-03 17:57
User 58385229-Dec-03 17:57 
GeneralNeed help with ODBC database/Edit box Pin
Zombie_Inc28-Dec-03 12:15
Zombie_Inc28-Dec-03 12:15 
GeneralRe: Need help with ODBC database/Edit box Pin
PJ Arends28-Dec-03 15:24
professionalPJ Arends28-Dec-03 15:24 
GeneralSimple Problem. How can I show an "Open file" dialog in a dialog-based App from MFC AppWizard Pin
andreir2328-Dec-03 12:07
andreir2328-Dec-03 12:07 
GeneralRe: Simple Problem. How can I show an "Open file" dialog in a dialog-based App from MFC AppWizard Pin
User 665828-Dec-03 12:52
User 665828-Dec-03 12:52 
GeneralRe: Simple Problem. How can I show an "Open file" dialog in a dialog-based App from MFC AppWizard Pin
andreir2328-Dec-03 15:20
andreir2328-Dec-03 15:20 
GeneralDialog problem Pin
Selevercin28-Dec-03 12:06
Selevercin28-Dec-03 12:06 
GeneralRe: Dialog problem Pin
User 58385228-Dec-03 14:08
User 58385228-Dec-03 14:08 
GeneralRe: Dialog problem Pin
Selevercin28-Dec-03 15:27
Selevercin28-Dec-03 15:27 
GeneralRe: Dialog problem Pin
User 58385228-Dec-03 15:36
User 58385228-Dec-03 15:36 
Generalcustom appwizard and images (Visual Studio 6.0) Pin
juthus28-Dec-03 10:32
juthus28-Dec-03 10:32 
GeneralCTreeCtrl and GetItem Problem Pin
User 1278228-Dec-03 9:33
User 1278228-Dec-03 9:33 
GeneralRe: CTreeCtrl and GetItem Problem Pin
PJ Arends28-Dec-03 15:53
professionalPJ Arends28-Dec-03 15:53 

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.