X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 72974D1B509 for ; Tue, 28 Oct 2003 16:43:53 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 23053-05 for ; Tue, 28 Oct 2003 12:43:22 -0400 (AST) Received: from mail.deltav.hu (oldmail.deltav.hu [213.163.0.192]) by svr1.postgresql.org (Postfix) with ESMTP id 62719D1B52F for ; Tue, 28 Oct 2003 12:43:20 -0400 (AST) Received: from fejleszt4 ([213.163.10.103]) by mail.deltav.hu (Netscape Messaging Server 3.6) with SMTP id AAA60DE for ; Tue, 28 Oct 2003 17:43:16 +0100 Message-ID: <074b01c39d72$6f512f90$0403a8c0@fejleszt4> From: "=?iso-8859-2?B?U1rbQ1MgR+Fib3I=?=" To: References: <072c01c39d65$65f83950$0403a8c0@fejleszt4> <20031028154536.GA29427@it.is.rice.edu> Subject: Re: numeric and float converts to int differently? Date: Tue, 28 Oct 2003 17:42:10 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/368 X-Sequence-Number: 15768 Dear Ken, reply goes to the list if you don't mind :) ----- Original Message ----- From: "Kenneth Marshall" To: "SZÛCS Gábor" Sent: Tuesday, October 28, 2003 4:45 PM > Postgres is using the standard definition of rounding. What you The "standard" definition I know states that 0.5 should round *up*, not *away from zero*. i.e. 3.5 rounds (up) to 4, and -3.5 rounds (up) to -3. I was just wondering if there is an explicit/official claim that Postgres does round away from zero. > cannot see is that the float values are not actually exactly 0.5 Yes I could guess that (floating point vs fixed), but is this a coincidence that both '0.5'::float and '-0.5'::float are closer to 0, whereas they could be closer to +/-1, as well as both closer to the lower or upper bound. This is why I asked if it's intentional/guaranteed, or undefined -- say, a future change in glibc may cause this to change. > I cannot imagine that the behavior would ever change. If you can tell the developers' opinion for sure, that's enough for me :) G. ------------------------------- cut here -------------------------------