50.000000000001
instead?"This is called roundoff error, and can happen sometimes when doing calculations on floating point data types (such as double
or float
). In short, floating point arithmetic isn't guaranteed to be absolutely 100% precise. This is not an error on your part.