3.75 on Redhat 5.6 does not have a problem.


I get

8.88

16.88

32.88

64.88



Fixed in 3.7.5 maybe?





Michael D. Black

Senior Scientist

NG Information Systems

Advanced Analytics Directorate



________________________________
From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Luuk [luu...@gmail.com]
Sent: Saturday, April 30, 2011 7:04 AM
To: General Discussion of SQLite Database
Subject: EXT :Re: [sqlite] BUG : round(x,y) not consistent

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-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to