On Sat, Sep 17, 2005 at 02:12:45AM +0200, Daniel Schuchardt wrote:
> CIMSOFT=# SELECT n1/1 FROM test;
> ?column?
> ------------------
> 2.45667695999146
> (1 row)
>
> Why I get so many digits by a division with one? Anybody should have
> learned that everything / 1 = everything ;-)
Looks like the division is being done in double precision (float8)
and you're seeing the effects of an inexact representation.
test=> SELECT 2.456677::real / 1;
?column?
------------------
2.45667695999146
(1 row)
test=> SELECT 2.456677::real / 1::real;
?column?
----------
2.45668
(1 row)
--
Michael Fuhr