We get an ArithmeticException (Overflow or underflow in the arithmetic operation.) in the following line on a customer machine. We are not able to reproduce it on any PC (customers or ours):
var actualFullness = (byte)((hdd.Capacity - hdd.FreeSpace) / (float)hdd.Capacity * 100);
where hdd.Capacity
and hdd.FreeSpace
are uint
. Values are from function in native DLL.
We use NO checked
or unchecked
keywords in program. We do NOT use /checked compiler option.
It is written in .NET 4 and is running as 32-bit process.
Any idea why this exception is thrown?