Hi folks,
i've noticed an problem with conversion from real to float -
this produces ugly values. (in fact it seems to be real->float8)
> fxignal=# SELECT 12.345::real::float;
> float8
> ------------------
> 12.3450002670288
Maybe its not really an conversion problem, but an bug in sprintf(),
(there were some other float related bugs known in glibc), as these
examples let me suspect:
> fxignal=# SELECT 12.345::real::float::real;
> float4
> --------
> 12.345
> fxignal=# SELECT ((12.345::real::float8)-(0.345::float8))::real;
> float4
> --------
> 12
I noticed this behaviour on postgresql-7.4.1 and 7.4.3 on glibc-2.3.2
BTW: real is an alias to float4 ?
regards,
--
---------------------------------------------------------------------
Enrico Weigelt == metux IT service
phone: +49 36207 519931 www: http://www.metux.de/
fax: +49 36207 519932 email: contact@metux.de
cellphone: +49 174 7066481
---------------------------------------------------------------------
-- DSL ab 0 Euro. -- statische IP -- UUCP -- Hosting -- Webshops --
---------------------------------------------------------------------