Why does numeric_out produce so many trailing zeros? - Mailing list pgsql-hackers

From David Rowley
Subject Why does numeric_out produce so many trailing zeros?
Date
Msg-id CAApHDvpPn=RYYaJ1iOarpw4XHNQov-72y92QfU1KcG7e_=o1Ow@mail.gmail.com
Whole thread Raw
Responses Re: Why does numeric_out produce so many trailing zeros?
List pgsql-hackers
I've been reading the documents on numeric and I can't find any information on the reason that a query like this:

test=# select n::numeric / 1 from generate_series(1,2) s(n);
        ?column?
------------------------
 1.00000000000000000000
     2.0000000000000000
(2 rows)

produces results that have so many trailing zeros. Also I'm wondering why the first row has 20 trailing zeros and the 2nd row has just 16?

Is there any reason that we output any trailing zeros at all?

Regards

David Rowley

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: PostgreSQL Service on Windows does not start if data directory given is relative path
Next
From: Craig Ringer
Date:
Subject: Re: Compiling extensions on Windows