In specific situations, it seems that the difference between 0 and -0 show up.
Numbered Steps to Reproduce Problem:
I'm not quite sure, though two examples occur below.
Code Snippet (if applicable) to Reproduce Problem:
mob/Login()
var/list/l = list( list(0,-4,-5),
list(4,0,-6),
list(5,6,0)
)
var/x = 5 * (1 - 1)
var/y = -(5 * (1 - 1))
world << (x == y)
world << (x == -y)
world << l[1][1]
world << -l[1][1]
world << (l[1][1] == -l[1][1])
Expected Results:
That the results would be 1, 1, 0, 0, 1.
Actual Results:
The results are 1, 0, 0, 0, 0.
Does the problem occur:
Every time? Or how often? Every time.
In other user accounts? Yes.
On other computers? Yes.
When does the problem NOT occur?
Unsure. It appears that it only occurs when dealing with negating a value before a comparison, but I don't know if this is the only situation it does occur.
Workarounds:
Specifically checking if the value is equal to zero, e.g. through absolute values or etc.
[Edit]
And alternative test case is below:
var/f = 0
var/g = 0
world << (f == g) // 1
world << (f == -g) // 0
world << (-f == -g) // 1
world << (-f == g) // 0
It could be a compiler issue, VM issue, or both. This issue only happens when converting any variable with a 0 to negative (which confuses it as a -0). However, it still outputs like a regular 0.