Обсуждение: decimal digits precision for real and double precision types

Поиск
Список
Период
Сортировка

decimal digits precision for real and double precision types

От
PG Doc comments form
Дата:
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)?

Re: decimal digits precision for real and double precision types

От
Bruce Momjian
Дата:
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 +