Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lYVxj-0004u1-G6 for pgsql-docs@arkaria.postgresql.org; Mon, 19 Apr 2021 15:37:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lYVxh-0001br-Rj for pgsql-docs@arkaria.postgresql.org; Mon, 19 Apr 2021 15:37:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lYVxh-0001bi-Iz for pgsql-docs@lists.postgresql.org; Mon, 19 Apr 2021 15:37:21 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lYVxd-0006Hb-AE for pgsql-docs@lists.postgresql.org; Mon, 19 Apr 2021 15:37:21 +0000 Received: by mail-ej1-x632.google.com with SMTP id u21so53632160ejo.13 for ; Mon, 19 Apr 2021 08:37:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=WgZyebMpsOm8xFtaFJnueAahOKBcCcrqI79rUcscTiE=; b=wenmAuqFHFcgZGRELsNEMEvAXHCXJ0N8yB4z+sohga2g/HlkvbEcrQvbSMzGNn9cDb rYbD2MrfJNYdxRzAJU2lSv9yWQZQWG1itTZgIyseAxEwnwT15TLgmSwVaKDjMKAzZPB7 2YYIhSTl7HTcIjyhYPzeopVskG/0/lfMbvICZ3WVPDi56hSBRbNhXr32DgCtPHyu1Aov GQqMPu5E8XYBzCtiLJou+YWc89QM+SXYKOB6NGjBUZAbCvN1YDQgoB9CnPo+IZo1Kj6O UsF5BuweKq73hDlS8qnebmT/XpjvsELFaY7uIEsFGQD2r97jAi6ytPqWzutz2vfs1WH9 mOEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=WgZyebMpsOm8xFtaFJnueAahOKBcCcrqI79rUcscTiE=; b=cKuGLS5+T7BrOE6cB3nHZDLO9rMMmMEPPkP9nmXZ3imZmLKXgJwdb1JnSq1sylljhf O6/minpj3o+1f9nPNoCX2/4FDqMvQGOUuTddBpq/STSRLA7cJPJp541Dw1tv08kLDuEp i6eoVUCrEfYkiT0YHuJnbRjnfRSpqAhJJqzybGZ/2su2gzeBokpZyyTzsqHlltcZT/yU lsAXOlEJmLsCcgY+LA8z8QEeys/BOzl2qwf8AQxVJJ+ZJ5gAC4kivQp2iP8Vh4R/oSgw vQKAE652eDpB255w3BKHczrXfzzzs/OL9CFeHYJuJZB0qBOkb3zpoi/I93h7C+nQ3/Hu l74Q== X-Gm-Message-State: AOAM531iq79n6EaUX76iFyFgzVaqb4BxBMJtEA5fXGX2CZpgKpiW0A+2 miasVl0DLIJIju26b8YZ6JpFlw== X-Google-Smtp-Source: ABdhPJyTeXr3ChK6o88MAqluBkEGc67ybI4M1ROIt6xwMhSFwjCoFQ45f3o68yhWkUPS6Kdryv6lBA== X-Received: by 2002:a17:906:13d6:: with SMTP id g22mr22704045ejc.475.1618846635412; Mon, 19 Apr 2021 08:37:15 -0700 (PDT) Received: from localhost.localdomain (217-149-161-95.nat.highway.telekom.at. [217.149.161.95]) by smtp.gmail.com with ESMTPSA id he38sm8114277ejc.76.2021.04.19.08.37.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 08:37:15 -0700 (PDT) Message-ID: <40dea1e0254dc00213f0dd10afa5e668abf0d020.camel@cybertec.at> Subject: Re: Rounding strategy From: Laurenz Albe To: rudolphfroger@dreamsolution.nl, pgsql-docs@lists.postgresql.org Date: Mon, 19 Apr 2021 17:37:14 +0200 In-Reply-To: <161881920775.685.12293798764864559341@wrigleys.postgresql.org> References: <161881920775.685.12293798764864559341@wrigleys.postgresql.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2021-04-19 at 08:00 +0000, PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/13/functions-math.html > Description: > > The 'round' mathematical function documentation doesn't specify its rounding > strategy. If this would be documented then users can rely on its rounding > behavior. For double precision the rounding probably depends on your > platform. For numeric the function seems to round to nearest with ties going > away from zero (sometimes referred to as "round half up). 6.5 -> 7.0 and > -6.5 -> -7.0. +1 Yours, Laurenz Albe