I got a strange piece of code to debug which to my opinion should throw an exception but instead it produced totally odd results. Reduced it to these two lines:
Since both are 0. Try A = {1, 2} then you will get ans = 0
0
A = {1, 2}
ans = 0