Re: double precisoin type

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fabrice Chapuis <fabrice636861(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: double precisoin type
Date: 2024-03-01 16:12:56
Message-ID: 2873832.1709309576@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fabrice Chapuis <fabrice636861(at)gmail(dot)com> writes:
> Documentation says:
> double precision 8 bytes variable-precision, inexact 15 decimal digits
> precision

The documentation is stating the minimum number of decimal digits
that will be accurately reproduced. You got 16 reproduced correctly
in this example, but you were lucky.

float8out has a different rule, which is to emit enough digits to
describe the actually-stored binary value unambiguously, so that
dump and reload will not change the stored value.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tristan Partin 2024-03-01 16:42:19 Re: make BuiltinTrancheNames less ugly
Previous Message Alexander Korotkov 2024-03-01 15:33:05 Re: POC, WIP: OR-clause support for indexes