Click here to Skip to main content
15,944,950 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionError message observed while using Standard User Analyzer Pin
V K 26-Aug-08 2:18
V K 26-Aug-08 2:18 
Questionnewbie C question Pin
johnny alpaca6-Aug-08 2:12
johnny alpaca6-Aug-08 2:12 
AnswerRe: newbie C question Pin
toxcct6-Aug-08 2:32
toxcct6-Aug-08 2:32 
GeneralRe: newbie C question Pin
_AnsHUMAN_ 6-Aug-08 2:36
_AnsHUMAN_ 6-Aug-08 2:36 
GeneralRe: newbie C question Pin
toxcct6-Aug-08 2:38
toxcct6-Aug-08 2:38 
GeneralRe: newbie C question Pin
johnny alpaca6-Aug-08 2:39
johnny alpaca6-Aug-08 2:39 
GeneralRe: newbie C question Pin
Kwanalouie6-Aug-08 2:55
Kwanalouie6-Aug-08 2:55 
GeneralRe: newbie C question Pin
Maximilien6-Aug-08 2:58
Maximilien6-Aug-08 2:58 
johnny alpaca wrote:
They could be tested for almost equality as I understand it


Yes, you are right; floating points are not well represented in binary forms, so that a value like 1.4 can be stored as 1.39999999 or 1.400000001 ( for example)

so if yo need to compare floating point numbers, you have to check them against a pre-defined precision; they are identical "up to" a certain precision

for example:
double x;
double y;
double epsilon = 0.00001;

//they are equal if the difference between them is smaller than epsilon.
bool bEqual = fabs( x - y ) < epsilon;


this is a good read : http://docs.sun.com/source/806-3568/ncg_goldberg.html[^]



GeneralRe: newbie C question Pin
David Crow6-Aug-08 3:00
David Crow6-Aug-08 3:00 
Questionenteries in add remove program Pin
VCProgrammer6-Aug-08 1:56
VCProgrammer6-Aug-08 1:56 
AnswerRe: enteries in add remove program Pin
nisha000006-Aug-08 2:24
nisha000006-Aug-08 2:24 
GeneralRe: enteries in add remove program Pin
toxcct6-Aug-08 2:35
toxcct6-Aug-08 2:35 
AnswerRe: enteries in add remove program Pin
_AnsHUMAN_ 6-Aug-08 2:46
_AnsHUMAN_ 6-Aug-08 2:46 
GeneralRe: enteries in add remove program Pin
nisha000006-Aug-08 2:57
nisha000006-Aug-08 2:57 
QuestionXP Styles in Visual Studio 2003 Pin
__DanC__6-Aug-08 1:04
__DanC__6-Aug-08 1:04 
AnswerRe: XP Styles in Visual Studio 2003 Pin
Sarath C6-Aug-08 1:29
Sarath C6-Aug-08 1:29 
GeneralRe: XP Styles in Visual Studio 2003 Pin
__DanC__6-Aug-08 23:45
__DanC__6-Aug-08 23:45 
QuestionRGB differences Windows 2000 vs XP Pin
kildareflare6-Aug-08 1:04
kildareflare6-Aug-08 1:04 
AnswerRe: RGB differences Windows 2000 vs XP Pin
_AnsHUMAN_ 6-Aug-08 1:39
_AnsHUMAN_ 6-Aug-08 1:39 
GeneralRe: RGB differences Windows 2000 vs XP Pin
kildareflare6-Aug-08 2:21
kildareflare6-Aug-08 2:21 
GeneralRe: RGB differences Windows 2000 vs XP Pin
kildareflare6-Aug-08 4:08
kildareflare6-Aug-08 4:08 
QuestionVC7 libs on VC8 Pin
vikramlinux6-Aug-08 0:54
vikramlinux6-Aug-08 0:54 
AnswerRe: VC7 libs on VC8 Pin
Chris Losinger6-Aug-08 13:35
professionalChris Losinger6-Aug-08 13:35 
QuestionCritical section failed! Pin
SRKSHOME6-Aug-08 0:29
SRKSHOME6-Aug-08 0:29 
AnswerRe: Critical section failed! Pin
SandipG 6-Aug-08 0:37
SandipG 6-Aug-08 0: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.