Search Postgresql Archives

round returns -0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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..."


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux