Igor:
> http://en.wikipedia.org/wiki/Rounding#Round_half_to_even

So, are you saying round-half-to-even is the SQLite behaviour? I would
have expected it to have used the "normal" mathematical convention of
round-half-away-from-zero. The reason this is "normal" mathematical
behaviour is that any decimal result is likely to be a truncation of
the real result, e.g. "pi = 3.14195". The SQL standard leaves it up to
the implementation:

sec 4.4.1:
         An approximation obtained by rounding of a numerical value N for
         an <exact numeric type> T is a value V representable in T such
         that the absolute value of the difference between N and the nu-
         merical value of V is not greater than half the absolute value
         of the difference between two successive numerical values repre-
         sentable in T. If there are more than one such values V, then it is
         implementation-defined which one is taken.

So I guess "round half to even" is a reasonable interpretation, but
I'd like to see this, and all implementation-defined behaviour,
documented.

Phil Hibbs.
-- 
Don't you just hate self-referential sigs?
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to