round returns -0

Поиск
Список
Период
Сортировка
От Tony Dare
Тема round returns -0
Дата
Msg-id 5137FE9D.3070200@comcast.net
обсуждение исходный текст
Ответы Re: round returns -0
Список pgsql-general
I'm taking an standard deviation of a population and subtracting it from
the average of the same population and rounding the result. Sometimes
that result is negative and rounding it returns (or shows up as) a
negative zero (-0) in a SELECT.

basically:
SELECT
   client_name, avg(rpt_cnt),
   stddev_pop(rpt_cnt),
   round(avg(rpt_cnt) - stddev_pop(rpt_cnt))
from client_counts
group by client_name

and what I sometimes get is :
   client_name | a dp number | a dp number | -0

In postgresql-world, is -0 = 0?  Can I use that negative 0 in further
calculations without fear?  Is this a bug?

pg version is 9.2
OS is Windows 2003.

Thanks,

Wade Dare
"Committed to striving for an effort to try..."


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

Предыдущее
От: Ian Lawrence Barwick
Дата:
Сообщение: Re: ERROR: syntax error at or near ":"
Следующее
От: Ian Pilcher
Дата:
Сообщение: Trust intermediate CA for client certificates