> > select round(3.05, 1)
>3.0
>
>Is this expected behavior for SQLite?
>The documentation isn't specific on the rounding strategy that is used.
>
>My personal expectation was that this would round to 3.1.

You _expect_ that 3.05 will represent exactly as 3.05 in IEEE, but it 
that the case?  Should the nearest FP representation be 
3.049999999999998 then the round() function would work fine, which is 
likely.

In such case, add half a unit at the position below rounding 
position.  Half a unit is guaranteed to have an exact representation 
under IEEE (at least in my old time), being a power of 2.

[Binary] FP can be utterly misleading.

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

Reply via email to