Usually, double/float is used to represent floating-point numbers. But we encountered a problem when we used to double/float. Let’s have a look at the below code. This is a simple subtraction of two numbers. Output :
Double: 0,3–0,2 = 0.09999999999999998
Float: 0,3–0,2 = 0.10000001 Aren’t these results we didn’t expect…