mathematical expression
Author | Topic: mathematical expression |
---|---|
Apprentice
Member # 5546
|
written Monday, June 27 2005 20:17
Profile
The expression I want to use is this : total = x + (( y * 3 ) / 10) + ( z * 6 ) - a - b; Somehow, total gets assigned 0 even when x,y,z,a and b are non zero. Are the brackets causing any error? Also are staments like m = 0.3 * t; supported. Or will the 0.3 be rounded off to 0? Posts: 9 | Registered: Friday, February 25 2005 08:00 |
Off With Their Heads
Member # 4045
|
written Monday, June 27 2005 20:20
Profile
Homepage
Non-integers get rounded down. Hard to say what the problem is with the first expression unless you give the values that you put into it. -------------------- Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens. Smoo: Get ready to face the walls! Ephesos: In conclusion, yarr. Kelandon's Pink and Pretty Page!!: the authorized location for all things by me The Archive of all released BoE scenarios ever Posts: 7968 | Registered: Saturday, February 28 2004 08:00 |
Triad Mage
Member # 7
|
written Tuesday, June 28 2005 02:52
Profile
Homepage
Non-integer final products get rounded. m = .3 * t is supported, but yields an integer answer. -------------------- "At times discretion should be thrown aside, and with the foolish we should play the fool." - Menander ==== Drakefyre's Demesne - Happy Happy Joy Joy Encyclopedia Ermariana - Trapped in the Closet ==== You can take my Mac when you pry my cold, dead fingers off the mouse! Posts: 9436 | Registered: Wednesday, September 19 2001 07:00 |