TL;DR Why does the (int)Math.Pow(2,32)
return 0
on Mono and Int32.MinValue
on .NET ?
While testing my .NET-written code on Mono I've stumbled upon the following line:
var i = X / ( (int)Math.Pow(2,32) );
well that line doesn't make much sense of course and I've already changed it to long
.
I was however curious why didn't my code throw DivideByZeroException
on .NET so I've checked the return value of that expression on both Mono and .NET
Can anyone please explain me the results?