Re: [GENERAL] Numeric numbers
От | Vincenzo Romano |
---|---|
Тема | Re: [GENERAL] Numeric numbers |
Дата | |
Msg-id | CAHjZ2x6Tukqwx1udxLUL1G+aX7h1vGzeyuQ3Zn_cQ2+xLyNVew@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: [GENERAL] Numeric numbers (Melvin Davidson <melvin6925@gmail.com>) |
Ответы |
Re: [GENERAL] Numeric numbers
|
Список | pgsql-general |
2017-09-02 18:10 GMT+02:00 Melvin Davidson <melvin6925@gmail.com>:
On Sat, Sep 2, 2017 at 11:54 AM, Francisco Olarte <folarte@peoplecall.com> wrote:On Sat, Sep 2, 2017 at 4:16 PM, Олег Самойлов <olleg@mipt.ru> wrote:
> Hi all. I have silly question. Look at "numeric" type. According to
> docs it must be "up to 131072 digits before the decimal point; up to
> 16383 digits after the decimal point". Well, lets see.
>
> => select 1::numeric/3;
> ?column?
> ------------------------
> 0.33333333333333333333
=> select 1::numeric(100,90)/3;
?column?
------------------------------------------------------------ ------------------------------ ----
0.333333333333333333333333333333333333333333333333333333333 333333333333333333333333333333 333
(1 row)
It's probably doing 1(integer) => double precioson => numeric(20) or
something similar if you do not specify.
Francisco Olarte.
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general Franciso,Per the docs, is is not "must be', it is "up to 131072 digits before the decimal point; up to 16383 digits after the decimal point".YOU have specified a precision of numeric(100,90), which means 90 decimals and that is exactly what you got!The result is correct, so what is your question?
--Melvin Davidson
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.
The original snippet reads:
select 1::numeric/3;
And I think Francisco is asking why only 20 digits.
Vincenzo Romano - NotOrAnd.IT
Information Technologies
--
NON QVIETIS MARIBVS NAVTA PERITVS
Information Technologies
--
NON QVIETIS MARIBVS NAVTA PERITVS
В списке pgsql-general по дате отправления: