If we use a double in c# or a float in python, simple calculations using variables of 1 decimal place seem to not be correct. In both python and c#, if I perform the calculation 5.2 - 5.1, I get the answer 0.10000000000000053, when it should obviously be 0.1.
Can someone please explain to me why this is?
Also, in c#, we can use the decimal type to avoid this issue. Is there a similar type in python I can use?