ID:272170
 
Simple question: Does DM support BODMAS?
In response to YMIHere
All I was really looking for was a yes or no answer, not the list of operators. But, errr, thanks?
In response to Demon_F0rce
It shows the order of operations. =)

As far as I can tell it's a yes, but considering BODMAS is completely new to me at this time I figured it'd be better for you to see for yourself. =)

A note, the slash in the first line is the path operator, not division.
You should make yourself more clear rather than using uncommon abbreviations with no explanation;

If you're referring to grouping an expression in parenthesis to change the order of operations or make it execute first, then yes, DM supports it, and certain expressions require it.
A common example is when trying to check if an element isn't in a list by the 'in' operator, which has low precedence.
proc/check(List,item)
if(!item in List) //if the item isn't in the list
return 0
return 1 //otherwise, if it is, return 1

//in actuality, this evaluates to:
if( (!item) in List)
//which will be incorrect and would end as, for example:
if ( 0 in List )

//therefore in order to make it work, you need to use a \
parenthesis pair in your code

if( !(item in List) )


Also of course, your common math example...
mob/verb/do_math()
src << 3 + 2*3 //3+6=9
src << (3+2) * 3 //5*3=15
In response to Kaioken
Yeah... I meant BODMAS as in Brackets of Division Multiplication Addition Subtraction. I didn't know there was another kind...
In response to Demon_F0rce
The O actually stands for "exponentiation."

Somehow.
In response to Demon_F0rce
I think it's usually called the order of operations.
http://en.wikipedia.org/wiki/BOMDAS
In response to Demon_F0rce
To think, I thought it was only BEDMAS that was correct term lol.