Click here to Skip to main content
15,921,174 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDDX and DDV for dynamic CEdit Pin
JohnMFC26-Jan-06 1:21
JohnMFC26-Jan-06 1:21 
AnswerRe: DDX and DDV for dynamic CEdit Pin
Rage26-Jan-06 3:26
professionalRage26-Jan-06 3:26 
AnswerRe: DDX and DDV for dynamic CEdit Pin
Blake Miller26-Jan-06 10:42
Blake Miller26-Jan-06 10:42 
QuestionChanging directory in CFileDialog Pin
doctorpi26-Jan-06 0:57
doctorpi26-Jan-06 0:57 
AnswerRe: Changing directory in CFileDialog Pin
Cedric Moonen26-Jan-06 1:43
Cedric Moonen26-Jan-06 1:43 
AnswerRe: Changing directory in CFileDialog Pin
David Crow26-Jan-06 3:32
David Crow26-Jan-06 3:32 
Questionfrom where extra #s come when float is saved to double Pin
pc_dev25-Jan-06 23:40
pc_dev25-Jan-06 23:40 
AnswerRe: from where extra #s come when float is saved to double Pin
Rage26-Jan-06 0:36
professionalRage26-Jan-06 0:36 
From MSDN:

Floating Conversions
An object of a floating type can be safely converted to a more precise floating
type — that is, the conversion causes no loss of significance. 
For example, conversions from float to double or from double to long double are
safe, and the value is unchanged.

An object of a floating type can also be converted to a less precise type, if it
is in a range representable by that type. (See Floating Limits in Chapter 2 for 
he ranges of floating types.) 
If the original value cannot be represented precisely, it can be converted to
either the next higher or the next lower representable value. 
If no such value exists, the result is undefined. 
Consider the following example:

cout << (float)1E300 << endl;

The maximum value representable by type float is 3.402823466E38 — a much 
smaller number than 1E300. 
Therefore, the number is converted to infinity, and the result is 1.#INF.


What I think is that f=34.6376 is already "saved" as f=34.63759999, but you do
not see it explicitely. Try and debug-step through this:

float f=34.6376;
double d;
d=(double)f;

if (f==34.6376)
{
f=0;
}

if (d==34.6376)
{
d=0;
}


and you will see that it does not run into the if brackets.

~RaGE();

-- modified at 6:37 Thursday 26th January, 2006
AnswerRe: from where extra #s come when float is saved to double Pin
David Crow26-Jan-06 4:02
David Crow26-Jan-06 4:02 
AnswerRe: from where extra #s come when float is saved to double Pin
cmk26-Jan-06 12:29
cmk26-Jan-06 12:29 
QuestionAFX? Pin
Zanathel25-Jan-06 22:58
Zanathel25-Jan-06 22:58 
AnswerRe: AFX? Pin
Stephen Hewitt25-Jan-06 23:03
Stephen Hewitt25-Jan-06 23:03 
GeneralRe: AFX? Pin
Zanathel26-Jan-06 0:38
Zanathel26-Jan-06 0:38 
GeneralRe: AFX? Pin
Blake Miller26-Jan-06 10:44
Blake Miller26-Jan-06 10:44 
AnswerRe: AFX? Pin
Owner drawn26-Jan-06 18:18
Owner drawn26-Jan-06 18:18 
QuestionVisual C++ with voice Pin
Deys25-Jan-06 22:15
Deys25-Jan-06 22:15 
AnswerRe: Visual C++ with voice Pin
Cedric Moonen25-Jan-06 22:35
Cedric Moonen25-Jan-06 22:35 
GeneralRe: Visual C++ with voice Pin
Deys26-Jan-06 14:41
Deys26-Jan-06 14:41 
GeneralRe: Visual C++ with voice Pin
Cedric Moonen26-Jan-06 20:29
Cedric Moonen26-Jan-06 20:29 
AnswerRe: Visual C++ with voice Pin
Rage26-Jan-06 3:28
professionalRage26-Jan-06 3:28 
GeneralRe: Visual C++ with voice Pin
Deys26-Jan-06 14:43
Deys26-Jan-06 14:43 
AnswerRe: Visual C++ with voice Pin
David Crow31-Jan-06 2:48
David Crow31-Jan-06 2:48 
QuestionHow do we add color to a button? Pin
waxie25-Jan-06 22:11
waxie25-Jan-06 22:11 
AnswerRe: How do we add color to a button? Pin
RChin25-Jan-06 23:31
RChin25-Jan-06 23:31 
AnswerRe: How do we add color to a button? Pin
Stephen Hewitt26-Jan-06 17:24
Stephen Hewitt26-Jan-06 17:24 

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.