On 30-04-2011 14:04, Luuk wrote:
> On 29-04-2011 22:09, Jean-Marie CUAZ wrote:
>> Win XP + SQLite 3.7.4
>>
>> SELECT round(8.875,2) -> 8.88
>> SELECT round(16.875,2) -> 16.87
>> SELECT round(32.875,2) -> 32.88
>> SELECT round(64.875,2) -> 64.87
>>
>> I'm not sure SQLite is the actual culprit (and I'm aware the subject is
>> complicated) but it's annoying.
>>
>> Jean-MarieSQLite version 3.7.2
> Enter ".help" for instructions
> Enter SQL statements terminated with a ";"
> sqlite> .mode line
> sqlite> select round(2.875,2),round(4.875,2),round(8.875,2),
> round(16.875,2), round(32.875,2), round(64.875,2),round(128.875,2);
> round(2.875,2) = 2.87
> round(4.875,2) = 4.87
> round(8.875,2) = 8.88
> round(16.875,2) = 16.87
> round(32.875,2) = 32.88
> round(64.875,2) = 64.87
> round(128.875,2) = 128.88
> sqlite> select round(2.8755,3),round(4.8755,3),round(8.8755,3),
> round(16.8755,3), round(32.8755,3), round(64.8755,3),round(128.8755,3);
> round(2.8755,3) = 2.876
> round(4.8755,3) = 4.875
> round(8.8755,3) = 8.876
> round(16.8755,3) = 16.875
> round(32.8755,3) = 32.876
> round(64.8755,3) = 64.876
> round(128.8755,3) = 128.875
> sqlite>
>
> sqlite 3.7.2 in Windows7 and same result on openSUSE.... ;)
sqlite> select
round(1000*2.875,2),round(1000*4.875,2),round(1000*8.875,2),
round(1000*16.875,2), round(1000*32.875,2),
round(1000*64.875,2),round(1000*128.875,
2);
round(1000*2.875,2) = 2875.0
round(1000*4.875,2) = 4875.0
round(1000*8.875,2) = 8875.0
round(1000*16.875,2) = 16875.0
round(1000*32.875,2) = 32875.0
round(1000*64.875,2) = 64875.0
round(1000*128.875,2) = 128875.0
sqlite> select
round(1000*2.875,2)/1000,round(1000*4.875,2)/1000,round(1000*8.875,2)/1000,
round(1000*16.875,2)/1000, round(1000*32.875,2)/1000, round(1000*64.8
75,2)/1000,round(1000*128.875,2)/1000;
round(1000*2.875,2)/1000 = 2.875
round(1000*4.875,2)/1000 = 4.875
round(1000*8.875,2)/1000 = 8.875
round(1000*16.875,2)/1000 = 16.875
round(1000*32.875,2)/1000 = 32.875
round(1000*64.875,2)/1000 = 64.875
round(1000*128.875,2)/1000 = 128.875
sqlite>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users