Click here to Skip to main content
15,926,256 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralFilenames Pin
[James Pullicino]17-Oct-01 22:52
[James Pullicino]17-Oct-01 22:52 
GeneralRe: Filenames Pin
Jon Hulatt17-Oct-01 23:45
Jon Hulatt17-Oct-01 23:45 
GeneralRe: Filenames Pin
[James Pullicino]17-Oct-01 23:47
[James Pullicino]17-Oct-01 23:47 
GeneralRe: Filenames Pin
#realJSOP18-Oct-01 2:52
professional#realJSOP18-Oct-01 2:52 
GeneralRe: Filenames Pin
kumar_p318-Oct-01 3:14
kumar_p318-Oct-01 3:14 
Generalbasic math problem Pin
17-Oct-01 22:42
suss17-Oct-01 22:42 
GeneralRe: basic math problem Pin
markkuk17-Oct-01 23:38
markkuk17-Oct-01 23:38 
GeneralRe: basic math problem Pin
Jon Hulatt17-Oct-01 23:41
Jon Hulatt17-Oct-01 23:41 
When the compiler does the arithmetic, it completes the sums in operator precedence. different operators (*, / etc) are thus done in different orders, unless you use ()'s to change the order.

since the order is this (i think) .... * / + -

then your line:

float arg = (0.0f - 1.0f / 0.0f - 1.0f);

will do the divide operation first. Thus 1.0 / 0 is a divide by zero error.


it's good practise to always use parentheses to control the prescedence of your operations. suffiecient here would be:

float arg = (a.x - b.x) / (a.y - b.y);

Note that your original line,

float arg = (a.x - b.x / a.y - b.y);

since the ()'s were around the whole expression, they weren't doing anything at all.




Sorry to dissapoint you all with my lack of a witty or poignant signature.
Generalaaaaaaaaaarg Pin
17-Oct-01 23:49
suss17-Oct-01 23:49 
GeneralRe: aaaaaaaaaarg Pin
Jon Hulatt17-Oct-01 23:53
Jon Hulatt17-Oct-01 23:53 
GeneralPDH Requirements Pin
Anders Rundegren17-Oct-01 22:26
Anders Rundegren17-Oct-01 22:26 
GeneralI going to lost my job because the stupid ATL ! Please HELP !!!!!!! Pin
mimi17-Oct-01 21:08
mimi17-Oct-01 21:08 
GeneralRe: I going to lost my job because the stupid ATL ! Please HELP !!!!!!! Pin
Christian Graus17-Oct-01 21:31
protectorChristian Graus17-Oct-01 21:31 
GeneralATL Pin
mimi17-Oct-01 22:09
mimi17-Oct-01 22:09 
GeneralRe: ATL Pin
Christian Graus17-Oct-01 22:23
protectorChristian Graus17-Oct-01 22:23 
GeneralIs it possibility use in ATL resource Dialog ? Pin
mimi17-Oct-01 23:49
mimi17-Oct-01 23:49 
GeneralRe: Is it possibility use in ATL resource Dialog ? Pin
Christian Graus18-Oct-01 0:33
protectorChristian Graus18-Oct-01 0:33 
GeneralRe: Is it possibility use in ATL resource Dialog ? Pin
Christian Graus18-Oct-01 2:23
protectorChristian Graus18-Oct-01 2:23 
Generalabout "DllMain" Pin
Maer72717-Oct-01 20:26
Maer72717-Oct-01 20:26 
GeneralRe: about "DllMain" Pin
Michael Dunn17-Oct-01 20:34
sitebuilderMichael Dunn17-Oct-01 20:34 
GeneralRe: about "DllMain" Pin
Maer72718-Oct-01 13:33
Maer72718-Oct-01 13:33 
GeneralRe: about "DllMain" Pin
Michael Dunn18-Oct-01 13:45
sitebuilderMichael Dunn18-Oct-01 13:45 
GeneralRe: about "DllMain" Pin
Maer72718-Oct-01 17:59
Maer72718-Oct-01 17:59 
Generalabout "UNREFERENCED_PARAMETER" Pin
Maer72717-Oct-01 20:21
Maer72717-Oct-01 20:21 
GeneralRe: about "UNREFERENCED_PARAMETER" Pin
Michael Dunn17-Oct-01 20:36
sitebuilderMichael Dunn17-Oct-01 20:36 

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.