Click here to Skip to main content
15,888,908 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Are these template classes equivalent? Pin
Zac Howland4-Aug-06 4:19
Zac Howland4-Aug-06 4:19 
GeneralRe: Are these template classes equivalent? Pin
Steve Echols4-Aug-06 5:15
Steve Echols4-Aug-06 5:15 
GeneralRe: Are these template classes equivalent? Pin
Zac Howland4-Aug-06 5:32
Zac Howland4-Aug-06 5:32 
QuestionComparison of double values Pin
velayudhan3-Aug-06 20:48
velayudhan3-Aug-06 20:48 
AnswerRe: Comparison of double values Pin
prasad_som3-Aug-06 21:30
prasad_som3-Aug-06 21:30 
AnswerRe: Comparison of double values Pin
Hamid_RT3-Aug-06 22:33
Hamid_RT3-Aug-06 22:33 
AnswerRe: Comparison of double values Pin
Naveen3-Aug-06 22:54
Naveen3-Aug-06 22:54 
AnswerRe: Comparison of double values Pin
Zac Howland4-Aug-06 4:30
Zac Howland4-Aug-06 4:30 
When comparing floating point/double values, you should pick some small value and compare the difference of your two values to that value. For example:

double x = 3.14159265;
double y = 3.141592654;
const double epsilon = 0.00001;

bool IsEqualTo(double x, double y, double epsilon)
{
	return (abs(x - y) < epsilon);
}

bool test = IsEqualTo(x, y, epsilon);	// test == true


Small differences in precision can creep up when doing math with floats and doubles. Comparing their difference with some small value allows you to control which precision is important to you.

If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week

Zac

QuestionCoCreateInstance spawns a new thread why ? Pin
logicaldna3-Aug-06 20:23
logicaldna3-Aug-06 20:23 
QuestionHow to avoid Bitmap Color Invert in Menu Pin
Parthi_Appu3-Aug-06 19:59
Parthi_Appu3-Aug-06 19:59 
QuestionRe: How to avoid Bitmap Color Invert in Menu Pin
Parthi_Appu3-Aug-06 21:06
Parthi_Appu3-Aug-06 21:06 
AnswerRe: How to avoid Bitmap Color Invert in Menu Pin
Hamid_RT3-Aug-06 22:05
Hamid_RT3-Aug-06 22:05 
GeneralRe: How to avoid Bitmap Color Invert in Menu Pin
Parthi_Appu3-Aug-06 22:29
Parthi_Appu3-Aug-06 22:29 
QuestionDirectX Programming Basics Pin
Kuroro Rucilful3-Aug-06 17:29
Kuroro Rucilful3-Aug-06 17:29 
AnswerRe: DirectX Programming Basics Pin
uusheikh3-Aug-06 18:07
uusheikh3-Aug-06 18:07 
GeneralRe: DirectX Programming Basics Pin
Kuroro Rucilful3-Aug-06 19:07
Kuroro Rucilful3-Aug-06 19:07 
GeneralRe: DirectX Programming Basics Pin
Kuroro Rucilful3-Aug-06 19:40
Kuroro Rucilful3-Aug-06 19:40 
Question[Message Deleted] Pin
GameDesignerXIX3-Aug-06 16:27
GameDesignerXIX3-Aug-06 16:27 
AnswerRe: Vector List Pin
Christian Graus3-Aug-06 16:48
protectorChristian Graus3-Aug-06 16:48 
GeneralRe: Vector List Pin
GameDesignerXIX3-Aug-06 16:58
GameDesignerXIX3-Aug-06 16:58 
GeneralRe: Vector List Pin
Christian Graus3-Aug-06 17:05
protectorChristian Graus3-Aug-06 17:05 
AnswerRe: Vector List [modified] Pin
John M. Drescher3-Aug-06 16:51
John M. Drescher3-Aug-06 16:51 
GeneralRe: Vector List Pin
GameDesignerXIX3-Aug-06 16:52
GameDesignerXIX3-Aug-06 16:52 
AnswerRe: [Message Deleted] Pin
ThatsAlok3-Aug-06 17:57
ThatsAlok3-Aug-06 17:57 
GeneralRe: [Message Deleted] Pin
Christian Graus3-Aug-06 18:11
protectorChristian Graus3-Aug-06 18:11 

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.