Interestingly, SQLite gets it wrong, returning 2.0, but MySQL, MariaDB, Postgres, and Cockroach all get it right at 1.0
I guess this comes down to most of them having implementations of arbitrary precision decimals.
I guess this comes down to most of them having implementations of arbitrary precision decimals.
If you stored your values in table rows as DOUBLE PRECISION, you would of course get the wrong answer.