Re: [GENERAL] Numeric numbers

2017-09-02 Thread Олег Самойлов
Thanks for the answer, Tom. Now it's become clear. On Sat, 2017-09-02 at 16:20 -0400, Tom Lane wrote: > The information you're missing here is that a numeric value carries a > "display scale" value which indicates how many fractional digits to > print. > So "0.0" (scale 1) and

Re: [GENERAL] Numeric numbers

2017-09-02 Thread Tom Lane
=?UTF-8?Q?=D0=9E=D0=BB=D0=B5=D0=B3_?= =?UTF-8?Q?=D0=A1=D0=B0=D0=BC=D0=BE=D0=B9=D0=BB=D0=BE=D0=B2?= writes: > What did you mean? 0. is not 0 indeed, but wrongly > show as 0. Or it's 0, but badly formated as 0.? Really? regression=# select

Re: [GENERAL] Numeric numbers

2017-09-02 Thread Олег Самойлов
On Sat, 2017-09-02 at 11:41 -0700, David G. Johnston wrote: > > There is only 20 "3" after ".". Well, may be this is not a problem, > > but > > why are they infinite number of "0" after the point? I can write > > even > > > > => select (1::numeric/3-0.)*1e10; > >

Re: [GENERAL] Numeric numbers

2017-09-02 Thread David G. Johnston
On Saturday, September 2, 2017, Олег Самойлов wrote: > > There is only 20 "3" after ".". Well, may be this is not a problem, but > why are they infinite number of "0" after the point? I can write even > > => select (1::numeric/3-0.)*1e10; > ?column?

Re: [GENERAL] Numeric numbers

2017-09-02 Thread Francisco Olarte
Олег: On Sat, Sep 2, 2017 at 7:04 PM, Олег Самойлов wrote: ... >> Well, I just skipped over the rest of the code. I consider casting to >> unespecified numeric widths a very bad habit and did not want to >> encourage it. > There is nothing in documentation that this casting is a

Re: [GENERAL] Numeric numbers

2017-09-02 Thread Олег Самойлов
On Sat, 2017-09-02 at 18:58 +0200, Francisco Olarte wrote: > CCing the list ( hint: use reply all in your MUA, otherwhise people > will loose the thread, this message came only for me. If that was > what > you wnated, please indicate so in future messages, as the custom in > this list is to reply

Re: [GENERAL] Numeric numbers

2017-09-02 Thread Francisco Olarte
CCing the list ( hint: use reply all in your MUA, otherwhise people will loose the thread, this message came only for me. If that was what you wnated, please indicate so in future messages, as the custom in this list is to reply to list + posters ) On Sat, Sep 2, 2017 at 6:21 PM, Олег Самойлов

Re: [GENERAL] Numeric numbers

2017-09-02 Thread Francisco Olarte
Vincenzo: On Sat, Sep 2, 2017 at 6:20 PM, Vincenzo Romano wrote: > And I think Francisco is asking why only 20 digits. No need to think, I wasn't asking anything. I'm used to FLOAT ( I think actually DP )numbers being converted to numeric(,20), and I normally never

Re: [GENERAL] Numeric numbers

2017-09-02 Thread Олег Самойлов
On Sat, 2017-09-02 at 17:54 +0200, Francisco Olarte wrote: > It's probably doing 1(integer) => double precioson => numeric(20) or > something similar if you do not specify. >  > Francisco Olarte. Well, the question was not only about why there is only 20 "3" after point, I suspect this (may be

Re: [GENERAL] Numeric numbers

2017-09-02 Thread Scott Marlowe
On Sat, Sep 2, 2017 at 10:10 AM, Melvin Davidson wrote: > > > On Sat, Sep 2, 2017 at 11:54 AM, Francisco Olarte > wrote: >> >> On Sat, Sep 2, 2017 at 4:16 PM, Олег Самойлов wrote: >> > Hi all. I have silly question. Look at "numeric"

Re: [GENERAL] Numeric numbers

2017-09-02 Thread Vincenzo Romano
2017-09-02 18:10 GMT+02:00 Melvin Davidson : > > On Sat, Sep 2, 2017 at 11:54 AM, Francisco Olarte > wrote: > >> On Sat, Sep 2, 2017 at 4:16 PM, Олег Самойлов wrote: >> > Hi all. I have silly question. Look at "numeric" type.

Re: [GENERAL] Numeric numbers

2017-09-02 Thread Vincenzo Romano
Quoting from documentation: "without any precision or scale [you get] a column in which values of any precision and scale can be stored, up to the implementation limit on precision." I suspect the cast is doing some precision limitation. -- Vincenzo Romano - NotOrAnd.IT Information Technologies

Re: [GENERAL] Numeric numbers

2017-09-02 Thread Melvin Davidson
On Sat, Sep 2, 2017 at 11:54 AM, Francisco Olarte wrote: > On Sat, Sep 2, 2017 at 4:16 PM, Олег Самойлов 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

Re: [GENERAL] Numeric numbers

2017-09-02 Thread Francisco Olarte
On Sat, Sep 2, 2017 at 4:16 PM, Олег Самойлов 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; >

[GENERAL] Numeric numbers

2017-09-02 Thread Олег Самойлов
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. Well,