Float and double are imprecise - they have a finite amount of bits to represent a value.
Because humans use base 10, and computers use base 2, numbers that appear "simple" to us can be impossible to represent accurately as a float/double, especially the results of computations due to way CPUs execute them.