On 4 Apr 2019, at 17:15, James K. Lowden <jklow...@schemamania.org> wrote:
> 
> On Wed, 3 Apr 2019 14:30:52 +0200
> Lifepillar <lifepil...@icloud.com> wrote:
> 
> 
>> SQLite3 Decimal is an extension implementing exact decimal arithmetic
>> for SQLite3. It is currently unfinished and under development.  
> ...
>> I welcome any feedback, from the super-technical to the
>> end-user oriented. There is no manual so far, but the code is mostly
>> documented. 
> 
> What does divide-by-zero yield?  

By default:

sqlite> select decDiv(1,0);
Error: Division by zero

You have the option to ignore the error, though, in which case you get +Inf:

sqlite> delete from decTraps where flag = 'Division by zero';
sqlite> select decStr(decDiv(1,0));
Infinity

decTraps is a virtual table containing a list of flags which, when set by some 
function, raise an error. The flags are from IEEE 754.

> If NULL, no amount of exactitude will matter.  If the library is based
> on math, on the other hand, that would be a boon to SQLite users.  

NULLs are avoided where other results make sense. For instance:

sqlite> create table T (n blob);
sqlite> select decStr(decSum(n)) from T; -- Sum of an empty set of values
0
sqlite> select decStr(decAvg(n)) from T; -- Avg. of empty set of values
NaN

Life.


_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to