Search Postgresql Archives

Re: round behavior differs between 8.1.5 and 8.3.7

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

 



Robert Morton <morton2002@xxxxxxxxx> writes:
> Perhaps there are platform differences, since the version I am using was
> built with Microsoft Visual Studio:

Ah, now you tell us.

round(float8) just calls the platform's rint() function.  At least on
platforms that have rint(), which maybe Windows doesn't.  In that case
it's going to come down to src/port/rint.c, which is not particularly
careful about the exactly-0.5 case.  I think fully-standards-conformant
versions of rint() are probably going to use a "round to nearest even
integer" rule in such cases.  But by and large, float8 arithmetic *is*
going to have platform-specific behaviors; you're living in a fantasy
world if you think otherwise.

			regards, tom lane

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