decimal digits precision for real and double precision types

Started by PG Bug reporting formalmost 8 years ago2 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/10/static/datatype-numeric.html
Description:

In table 8.2 for numeric types, when the documentation states "6 decimal
digits precision" for the real type, we are talking about 6 digits after the
decimal point or 6 digits in total (before and after)?

#2Bruce Momjian
bruce@momjian.us
In reply to: PG Bug reporting form (#1)
Re: decimal digits precision for real and double precision types

On Tue, Jul 17, 2018 at 07:15:41PM +0000, PG Doc comments form wrote:

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/10/static/datatype-numeric.html
Description:

In table 8.2 for numeric types, when the documentation states "6 decimal
digits precision" for the real type, we are talking about 6 digits after the
decimal point or 6 digits in total (before and after)?

Well the number is stored as a mantissa and exponent, so it is 6
mantissa digits plus an exponent from 1E-37 to 1E+37.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +