Why does numeric_out produce so many trailing zeros?

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Why does numeric_out produce so many trailing zeros?
Date: 2014-01-12 07:50:49
Message-ID: CAApHDvpPn=RYYaJ1iOarpw4XHNQov-72y92QfU1KcG7e_=o1Ow@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2014-01-12 08:54:49 Re: Compiling extensions on Windows
Previous Message David Rowley 2014-01-12 07:44:42 Re: PostgreSQL Service on Windows does not start if data directory given is relative path