I think the use of "integer" was the mathematical concept, not the sqlite concept. That makes that part of the description correct.
There are other possible issues: 1) It says "truncated" not "rounded". 1.7 truncated is 1, rounded is 2. 2) It says nothing about negative values of Y. For me at least, these are treated as 0. This might be system dependent or undefined behavior. 3) It says nothing about non-integer values of Y. For me at least, they are truncated (not rounded), so round(1.234,1.8) is 1.2. Again, this might be system dependent or undefined behavior. --David Garfield Peter Aronson writes: > Here's where I let my pedantic side out to play. The documentation for the > round() function on the SQLite website at > http://www.sqlite.org/lang_corefunc.html says: > > "The round(X,Y) function returns a string representation of the > floating-point > value X rounded to Y digits to the right of the decimal point. If the Y > argument > is omitted, the X value is truncated to an integer." > > However, if you actually say execute this SQL: > > select typeof(round(1.1)); > > You get real as a result, not text. Looking at roundFunc()'s source code in > sqlite3.c (from func.c) it indeed calls sqlite3_result_double(), not > sqlite3_result_text(). > > The "Using SQLite" book, I notice gets it right, however. > > Best, > > Peter > _______________________________________________ > sqlite-users mailing list > [email protected] > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

