Search Postgresql Archives

Re: Exponentiation confusion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On 13/10/2022 19:16 CEST Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
> 
> Erik Wienhold <ewie@xxxxxxxxx> writes:
> > On 13/10/2022 18:20 CEST Adrian Klaver <adrian.klaver@xxxxxxxxxxx> wrote:
> >> select power(10, -18::numeric);
> >> power
> >> --------------------
> >> 0.0000000000000000
> >> 
> >> Why is the cast throwing off the result?
> 
> > Calling power(numeric, numeric) is what I expect in that case instead of
> > downcasting the exponent argument to double precision, thus losing precision.
> 
> An inexact result isn't surprising, but it shouldn't be *that* inexact.

Ah, now I see the problem.  I saw a bunch of zeros but not that it's *all*
zeros.  Nevermind.

--
Erik





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux