round returns -0 - Mailing list pgsql-general

From Tony Dare
Subject round returns -0
Date
Msg-id 5137FE9D.3070200@comcast.net
Whole thread Raw
Responses Re: round returns -0
List 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 by date:

Previous
From: Ian Lawrence Barwick
Date:
Subject: Re: ERROR: syntax error at or near ":"
Next
From: Ian Pilcher
Date:
Subject: Trust intermediate CA for client certificates