Welcome to WebmasterWorld Guest from 22.214.171.124 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Become a Pro Member
Fotiman msg:4665987 1:24 am on Apr 26, 2014 (gmt 0)
The != operator has a higher precedence than the & operator, so your second expression can be written like this: (gRoofLocked & ((2 ^ number) != 0)) I haven't plugged in any numbers, but I imagine that would give you different results than your first example, which would evaluate like this: (((gRoofLocked & 2) ^ number) != 0) [ ...]
developer.mozilla.org Fotiman msg:4665988 1:38 am on Apr 26, 2014 (gmt 0)
Note, one of these will evaluate to a boolean while the other will evaluate to a number. lucy24 msg:4666041 7:32 am on Apr 26, 2014 (gmt 0)
Follow-up: Timestamp says it took me pretty exactly seven hours to figure out that I don't mean 2^blahblah. I mean Math.pow(2,blahblah). ### Working properly now.