Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iljIt-0000r6-Re for pgsql-docs@arkaria.postgresql.org; Mon, 30 Dec 2019 00:53:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iljIs-00034W-95 for pgsql-docs@arkaria.postgresql.org; Mon, 30 Dec 2019 00:53:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iljIr-00034P-Ol for pgsql-docs@lists.postgresql.org; Mon, 30 Dec 2019 00:53:02 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iljIk-0005EY-OT for pgsql-docs@lists.postgresql.org; Mon, 30 Dec 2019 00:53:00 +0000 Received: by mail-wm1-x32c.google.com with SMTP id d73so12830610wmd.1 for ; Sun, 29 Dec 2019 16:52:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=5Aew0aGRABZpneWqjlJS5of709TM1mc7kaLmCJDxdcM=; b=f1lqkq67QCM6+OzbNdgnD/Q3bPHCYuSAxIIcmEdeGW2gGRyZ9PpSPpRojOl9/IVhjF d/ZCZX3QKQY1ObcnKxKdL1hTrXw1Dnd2pNPfZtJ+MX4yl6ood3zJuledWfciCZutm1PE qntZ0QEEPNjubdw8g3SDUC1+zyq/pa5mvFgABHZMBf2GFW9c74aDxURPleC0NqsYqike 91b5YH6huEb3DdlGSmSyDRaL7jDBDF6aKXfos6HDfM3Zdm5AdIjQxH/LKYR61A0lmNH8 w0dNZer+lgYQddNwLSVA0xXNKKs4AhqUabE/u9a+gf8o2+UO61xXViCniptyu4hInZs4 LXNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=5Aew0aGRABZpneWqjlJS5of709TM1mc7kaLmCJDxdcM=; b=Ij8l0gDs/Vpp8VgX421jpn3qtJp2M8uMRwakYA7qYHYfW24mIDcHEQvTLMVIK+F8EG GHmlqpZJQr5go9RcCZw3Fy88yAqa5T37sVg+R1aNAt3QRcYhMeNlodgtdlZZZEsrf8iu yL0QfzvgLtk+u9iwsjcXyCE+KME7h+dEhAdtnSOYmq1z/pLdKoa/juFJqOGA3Ar6gc5q iRtVpXBTlUkyY9U1zlX8qlQN+RGoYlEoo5NVye/iKpa+3/f2PC2JQpdwOzW11WRNz9vc rO/oWLbOS4r92wWMHQhY9dPszHdKx7gbZ4tU5ileMhTXqyygV/jNeEE7QSn5gWljNVz3 5MdQ== X-Gm-Message-State: APjAAAUYA+Lc1nHzJusJcet/bDhJ2FG8+/jb2GmmMLPnErQlajDT4u/+ RmLnx76bz5aO4orkOXm8yc/OCKwMeh2OKL5qJUktMY165Y94lcQLtXE4//ElsI+cLt7x1iQfAwJ gdIoD0WIqnHV6gRk9hNjSq1v58fX6h/qxQMBF/8Ru3Mi8JiwfJ1ncKK1O+WzuQN1d+PKCDJAL3s DJUCqHlPJTYXgiGZR0 X-Google-Smtp-Source: APXvYqwaclp+Ii97k9Wt8mqd7JbyaCtRK8zprP1KAwjO8dtEx0XjgeB1adv5UNxh1DMCfze7Y0yx9A== X-Received: by 2002:a7b:c1c7:: with SMTP id a7mr29906017wmj.168.1577667172140; Sun, 29 Dec 2019 16:52:52 -0800 (PST) Received: from [10.8.8.7] ([185.94.189.189]) by smtp.gmail.com with ESMTPSA id n10sm43165897wrt.14.2019.12.29.16.52.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 29 Dec 2019 16:52:51 -0800 (PST) Subject: Re: Question to datatype.sgml To: Tatsuo Ishii , pgsql-docs@lists.postgresql.org References: <20191230.093451.1762483750956466101.t-ishii@sraoss.co.jp> From: Vik Fearing Message-ID: <79565c24-89ed-abfd-46df-4a23cde21b04@2ndquadrant.com> Date: Mon, 30 Dec 2019 01:52:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20191230.093451.1762483750956466101.t-ishii@sraoss.co.jp> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 30/12/2019 01:34, Tatsuo Ishii wrote: > Hi, > > Can you please someone elaborate what's the meaning of "even" in > datatype.sgml? > > > By default, floating point values are output in text form in their > shortest precise decimal representation; the decimal value produced is > closer to the true stored binary value than to any other value > representable in the same binary precision. (However, the output value is > currently never exactly midway between two > representable values, in order to avoid a widespread bug where input > routines do not properly respect the round-to-even rule.) This value will > ~~~~~~~~~~~~~~~~~~~ > use at most 17 significant decimal digits for float8 > values, and at most 9 digits for float4 values. > > > I think "even" means "equality" here, not "even" of "even and odd". It does actually mean "even and odd".  This kind of rounding is also called "Banker's Rounding". https://en.wikipedia.org/wiki/Rounding#Round_half_to_even -- Vik Fearing