for(var/a=1 to 12)
if(a%6==0) //I had to do that or no workie :(
world<<"Hi there."
if I do: if(!a%6), it doesn't come out true. :( If I do: if(a%6==0), it comes out true. What's going on?
ID:269304
May 17 2005, 10:39 am
|
|
for(var/a=1 to 12) if I do: if(!a%6), it doesn't come out true. :( If I do: if(a%6==0), it comes out true. What's going on? |
In response to Wizkidd0123
|
|
Oohhh, thanks Wizzie. :d
I'm good at math with paranthesis, but not DM stuff like that. :p |
In response to Hell Ramen
|
|
Tsk tsk...and that's pretty basic math too.
Absolute Zer0 |
In response to Absolute Zer0
|
|
Absolute Zer0 wrote:
Tsk tsk...and that's pretty basic math too. That's why I'm good at it. :p |
It's an order of operations issue: the ! operator has a higher precedence than the % operator, meaning that in if(!a % 6), it evaluates if((!a) % 6). Checking for if(!(a % 6)) would work the way you want it to. =)