ID:167842
 
BYOND Version: 3.5

Operating System: Microsoft Windows XP - SP 2

Detailed Problem Description:

The inverse operator mysteriously stopped working with the modulus operator

Code Snippet to Reproduce Problem:

var/number = 10//number divisible by 10
if(!number % 10) world << "Inverse works"
if(number % 10 == 0) world << "Regular check works"


This always comes out with "Regular check works". The number your dividing by doesn't seem to matter.

Does the problem occur:
Every time? Or how often? Everytime

On other computers? Unsure

In other user accounts? Makes no difference
SSJ2GohanDBGT wrote:
if(!number % 10) world << "Inverse works"


That's because ! is evaluated before the module operator, whereas % is evaluated before ==.

if(!(number % 10)) world << "Inverse works"


~~> Unknown Perosn
In response to Unknown Person (#1)
This is odd though, did they change the order of operation? It worked for a good two years, then the last time I compiled the source, it stopped working.

Either way, thanks UP.