Re: Problem with datatype REAL using the = (EQUAL) operator

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Problem with datatype REAL using the = (EQUAL) operator
Дата
Msg-id 20040215195554.GB570@wolff.to
обсуждение исходный текст
Ответ на Problem with datatype REAL using the = (EQUAL) operator  ("Javier Carlos" <javier@evaloportunidades.insp.mx>)
Список pgsql-bugs
On Thu, Feb 12, 2004 at 12:46:27 -0600,
  Javier Carlos <javier@evaloportunidades.insp.mx> wrote:
> ============================================================================
> bd_temporal=> SELECT * FROM tbl_temp WHERE var < 0.20;
>  var
> ------
>   0.1
>  0.11
> (2 rows)
> bd_temporal=> SELECT * FROM tbl_temp WHERE var = 0.11;
>  var
> -----
> (0 rows)
> bd_temporal=> SELECT * FROM tbl_temp WHERE var = '0.11';
>  var
> ------
>  0.11
> (1 row)
>
>
> If you know how this problem might be fixed, list the solution below:

If you want exact fractional numbers you should be using numeric, not float.
The problems you are seeing has to do with single precision and double
precision versions of .11 not being equal.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Problem with datatype REAL using the = (EQUAL) operator
Следующее
От: Tom Lane
Дата:
Сообщение: Re: copy problem