Divide a float4 by 1 - what is going on???????

From: Daniel Schuchardt <daniel_schuchardt(at)web(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Divide a float4 by 1 - what is going on???????
Date: 2005-09-17 00:12:45
Message-ID: dgfn17$nts$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi people,

can anyone explain what is going on here : ?

CIMSOFT=# CREATE TEMP TABLE test (n1 FLOAT4);
CREATE TABLE
CIMSOFT=# INSERT INTO test (n1) VALUES (2.456677);
INSERT 6571521 1
CIMSOFT=# SELECT * FROM test;
n1
---------
2.45668
(1 row)

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 ;-)

Thnx,
Daniel

PS :

PostgreSQL 8.0.0 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2
(mingw

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2005-09-17 00:20:11 Re: pg_ctl reload breaks our client
Previous Message Roger Hand 2005-09-16 23:56:25 Re: Setting WHERE on a VIEW with aggregate function.