mathematical expression

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: mathematical expression
Apprentice
Member # 5546
Profile #0
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
Profile Homepage #1
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
Profile Homepage #2
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