Computers use binary numbers to store information. Integers can be stored exactly, but fractional numbers are usually stored as "floating point numbers".
There are numbers that are easily written in base-10, which cannot be accurately represented in binary floating-point format, and 0.1 is a number.
You can store numbers accurately and work with numbers accurately. For example, the number 0.1 can be saved as 1 / 10 , in other words, saved as a numerator (1) and a denominator (10) with the understanding that the numerator is divisible by a denominator. Then a correctly written math library can work with these fractions and do the math for you. But this is much, much slower than just using floating point numbers, so this is not so often used. (And I think that in the banking sector they usually use integers instead of a floating point to store money, $ 1.23 can be saved as 123 with an implicit two decimal places. When working with money, a floating point is not accurate enough!)
source share