diff options
author | drh <drh@noemail.net> | 2006-05-11 13:25:39 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2006-05-11 13:25:39 +0000 |
commit | c806d8570e58ba019ec1ada5f849bc8d72ae6b3e (patch) | |
tree | a61829a60985a55fc3a94ce8ef1747ea74461f3f /src/func.c | |
parent | c1f4494e658431a5ee2907f43dd97e43673dc52f (diff) | |
download | sqlite-c806d8570e58ba019ec1ada5f849bc8d72ae6b3e.tar.gz sqlite-c806d8570e58ba019ec1ada5f849bc8d72ae6b3e.zip |
Fix comments on the implementation of the SUM() function. (CVS 3183)
FossilOrigin-Name: a8909f3e5fc67ac1ba7d1abd7fb0f4004fec5984
Diffstat (limited to 'src/func.c')
-rw-r--r-- | src/func.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/func.c b/src/func.c index 0cab2ffbd..5927e8ba0 100644 --- a/src/func.c +++ b/src/func.c @@ -16,7 +16,7 @@ ** sqliteRegisterBuildinFunctions() found at the bottom of the file. ** All other code has file scope. ** -** $Id: func.c,v 1.127 2006/04/07 13:26:43 drh Exp $ +** $Id: func.c,v 1.128 2006/05/11 13:25:39 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -840,16 +840,8 @@ struct SumCtx { ** that it returns NULL if it sums over no inputs. TOTAL returns ** 0.0 in that case. In addition, TOTAL always returns a float where ** SUM might return an integer if it never encounters a floating point -** value. -** -** I am told that SUM() should raise an exception if it encounters -** a integer overflow. But after pondering this, I decided that -** behavior leads to brittle programs. So instead, I have coded -** SUM() to revert to using floating point if it encounters an -** integer overflow. The answer may not be exact, but it will be -** close. If the SUM() function returns an integer, the value is -** exact. If SUM() returns a floating point value, it means the -** value might be approximated. +** value. TOTAL never fails, but SUM might through an exception if +** it overflows an integer. */ static void sumStep(sqlite3_context *context, int argc, sqlite3_value **argv){ SumCtx *p; |