SQLite Forum

Decimal128
Login
> But 0.1 * 10.0 does equal 1.0 if your arithmetic unit is working properly.

Since there exists no such exact number (in binary floating-point) as 0.1, it can't if your arithmetic unit is working properly.

0.1 in binary is the repeating number 0.0001100110011...

If you round that pattern to the nearest 64-bit binary floating-point number you will get

0.1000000000000000055511151231257827021181583404541015625

Which when you multiply by ten you will get

1.000000000000000055511151231257827021181583404541015625

Which may display as == 1.0000 but if you compare them it won't be equals.