2 ms·
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
by thanatos_dem 8y ago
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.
- zeroimpl 8y agoIn PostgreSQL, if you specify a decimal literal, it is assumed to be type NUMERIC (arbitrary precision) by default, as opposed to FLOAT or DOUBLE PRECISION. If you stored your values in table rows as DOUBLE PRECISION, you would of course get the wrong answer.