SQLite Forum

change in round() function
Login
Hi, sorry if this has been asked before, or if I missed the thread in this forum or the old mailing list.

The behavior of the round() function seems to have changed between v3.28 and v3.29, but I don't see where it is mentioned in the release notes.

On my FreeBSD 11.3 server, v3.29 is the default SQLite, and I see this:
SQLite version 3.29.0 2019-07-10 17:32:03
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> select round(1.15,1); select round(9.95,1);
1.2
10.0

On my iMac running macOS Catalina (10.15.3), the built-in sqlite3 is v3.28:
SQLite version 3.28.0 2019-04-15 14:49:49
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> select round(1.15,1); select round(9.95,1);
1.1
9.9

I found the example numbers in mailing list.

How is the newer round() implemented?

Here are the release notes for v3.29:
2019-07-10 (3.29.0)

Added the SQLITE_DBCONFIG_DQS_DML and SQLITE_DBCONFIG_DQS_DDL actions to sqlite3_db_config() for activating and deactivating the double-quoted string literal misfeature. Both default to "on" for legacy compatibility, but developers are encouraged to turn them "off", perhaps using the -DSQLITE_DQS=0 compile-time option.
-DSQLITE_DQS=0 is now a recommended compile-time option.
Improvements to the query planner:
Improved optimization of AND and OR operators when one or the other operand is a constant.
Enhancements to the LIKE optimization for cases when the left-hand side column has numeric affinity.
Added the "sqlite_dbdata" virtual table for extracting raw low-level content from an SQLite database, even a database that is corrupt.
Enhancements to the CLI:
Add the ".recover" command which tries to recover as much content as possible from a corrupt database file.
Add the ".filectrl" command useful for testing.
Add the long-standing ".testctrl" command to the ".help" menu.
Added the ".dbconfig" command