Re: BUG #3959: Huge calculation error

Поиск
Список
Период
Сортировка
От Rodriguez Fernando
Тема Re: BUG #3959: Huge calculation error
Дата
Msg-id 47B3068A.6000906@ort.edu.uy
обсуждение исходный текст
Ответ на BUG #3959: Huge calculation error  ("Renaud Diez" <rdiez@salesprize.com>)
Список pgsql-bugs
Renaud Diez wrote:
> The following bug has been logged online:
>
> Bug reference:      3959
> Logged by:          Renaud Diez
> Email address:      rdiez@salesprize.com
> PostgreSQL version: 8.2
> Operating system:   Debian
> Description:        Huge calculation error
> Details:
>
> the basic mathematical expression like the following one doesn't compute the
> correct result:
>
>
>> select 100*(1+(21/100));
>>
>
> return a result of 100 instead of 121.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>
>
Hola, en realidad no lo hace mal, no es lo que esprabas, lo que en
realidad necesitas es esto:
select 100*(1+(21.0/100))::float;
saludos Fernando

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

Предыдущее
От: Adam Hardy
Дата:
Сообщение: Re: BUG #3894: JDBC DatabaseMetaData.getTables is inconsistently case-sensitive with schema name
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #3958: Self-Join Group-By Clause Produces Incorrect Results