Re: [HACKERS] 123.45 - 123 = 0.45

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] 123.45 - 123 = 0.45
Дата
Msg-id 199812151427.JAA14246@candle.pha.pa.us
обсуждение исходный текст
Ответ на 123.45 - 123 = 0.45  (Sferacarta Software <sferac@bo.nettuno.it>)
Ответы Re: [HACKERS] 123.45 - 123 = 0.45  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> Hi all,
> 
> I tried to divide 123.45 by 123.00 but PostgreSQL gives me a wrong
> result:
> 
> hygea=> select 123.45 - 123.00;
>          ?column?
> -----------------
> 0.450000000000003
> (1 row)
> 

Wow, I get the same thing here.

Even this doesn't work:
test=> select float8(123.45) - float8(123.00);         ?column?-----------------0.450000000000003(1 row)

Now constants are automatically promoted to float8, so I expected the
same results, but what is going on here?

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Sferacarta Software
Дата:
Сообщение: Re[2]: [HACKERS] JOIN syntax. Examples?
Следующее
От: Vince Vielhaber
Дата:
Сообщение: Re: [HACKERS] 123.45 - 123 = 0.45