Click here to Skip to main content
15,915,508 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: File Compiling Order in VC++ Pin
Aaron K.B. Huang20-Jan-02 21:58
Aaron K.B. Huang20-Jan-02 21:58 
GeneralCProgressCtrl Pin
RobJones20-Jan-02 18:13
RobJones20-Jan-02 18:13 
GeneralRe: CProgressCtrl Pin
Michael Dunn20-Jan-02 19:00
sitebuilderMichael Dunn20-Jan-02 19:00 
GeneralRe: CProgressCtrl Pin
RobJones20-Jan-02 19:23
RobJones20-Jan-02 19:23 
GeneralArithmetic Expression Pin
Geoffrey20-Jan-02 17:36
Geoffrey20-Jan-02 17:36 
GeneralRe: Arithmetic Expression Pin
Jon Sagara20-Jan-02 18:03
Jon Sagara20-Jan-02 18:03 
GeneralRe: Arithmetic Expression Pin
Jon Hulatt20-Jan-02 21:58
Jon Hulatt20-Jan-02 21:58 
GeneralRe: Arithmetic Expression Pin
Christian Graus20-Jan-02 22:08
protectorChristian Graus20-Jan-02 22:08 
Jon Hulatt wrote:
n5=n5- 7 + (2 / (3 *10)) ;

This is wrong. It evaluates as I said in the lounge - 2 gets divided by 3 and the result multiplied by 10, so that part comes to zero ( because 2 and 3 are not floats ), but if it gets made 2.0 and 3.0, you get 6.666(10 * .66666), not 0.0666 (2/30). / and * have equal precedence, left to right.

So the correct way to use brackets to show order of operation is

7 + ((2/3)*10)

and the 2 and 3 should be floats in order to get an answer other than 7.

Also, are you recommending not using -= here, or am I misreading you ?

Jon Hulatt wrote:
f2= 10.0 - (18.0 / (-3.0 * 2.5e-1));

Again, this is wrong - put it into a console application and see for yourself. The result is 11.5, not 34 as your bracketing would evaluate to.



Christian

I have come to clean zee pooollll. - Michael Martin Dec 30, 2001

Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now

GeneralRe: Arithmetic Expression Pin
Jon Hulatt21-Jan-02 1:54
Jon Hulatt21-Jan-02 1:54 
GeneralRe: Arithmetic Expression Pin
Christian Graus21-Jan-02 5:45
protectorChristian Graus21-Jan-02 5:45 
GeneralArithmetic Pin
Geoffrey20-Jan-02 17:36
Geoffrey20-Jan-02 17:36 
GeneralRe: Arithmetic Pin
Christian Graus20-Jan-02 17:47
protectorChristian Graus20-Jan-02 17:47 
QuestionBest wat to download a file with http? Pin
Jay Beckert20-Jan-02 16:35
Jay Beckert20-Jan-02 16:35 
AnswerRe: Best wat to download a file with http? Pin
Michael Dunn20-Jan-02 16:55
sitebuilderMichael Dunn20-Jan-02 16:55 
GeneralRe: Best wat to download a file with http? Pin
Jay Beckert20-Jan-02 16:59
Jay Beckert20-Jan-02 16:59 
GeneralCopyMemory problems Pin
alex.barylski20-Jan-02 12:59
alex.barylski20-Jan-02 12:59 
GeneralRe: CopyMemory problems Pin
alex.barylski20-Jan-02 13:28
alex.barylski20-Jan-02 13:28 
Generalput images on GDI Pin
DiegoValdevino20-Jan-02 12:54
DiegoValdevino20-Jan-02 12:54 
GeneralRe: put images on GDI Pin
Christian Graus20-Jan-02 13:03
protectorChristian Graus20-Jan-02 13:03 
QuestionTopMost Maximized Window? Pin
DiegoValdevino20-Jan-02 12:50
DiegoValdevino20-Jan-02 12:50 
AnswerRe: TopMost Maximized Window? Pin
Andrew Peace20-Jan-02 14:39
Andrew Peace20-Jan-02 14:39 
Generalcreate an owned popup window Pin
20-Jan-02 12:18
suss20-Jan-02 12:18 
GeneralRe: create an owned popup window Pin
24-Jan-02 15:18
suss24-Jan-02 15:18 
GeneralSkin a window Pin
The_Server20-Jan-02 12:12
The_Server20-Jan-02 12:12 
GeneralRe: Skin a window Pin
Christopher Lord20-Jan-02 12:32
Christopher Lord20-Jan-02 12:32 

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.