Stephan Beal wrote:
> On Fri, Apr 22, 2016 at 8:43 AM, Clemens Ladisch <clemens at ladisch.de>
> wrote:
>> You can get problems only if
>> - you are not using enough precision, or
>> - the number does not represent a full second, but some random point
>> somewhere in the middle between two whole seconds.
>
> The latter is exactly the case here - fossil remembers the millisecond part
> during commits
Then you need to use enough precision for milliseconds:
sqlite> select julianday('2000-01-01 00:00:00.001') - julianday('2000-01-01
00:00:00.000');
1.16415321826935e-08
I.e., one more fractional digit than SQLite would use by default.
SQLite's C API returns floats as binary 64-bit numbers, so the problem
is with how you format them. You'd have to use printf("%.9f"), either
in SQL or in your code.
Regards,
Clemens