Re: Exponentiation confusion

Поиск
Список
Период
Сортировка
От Erik Wienhold
Тема Re: Exponentiation confusion
Дата
Msg-id 523542390.245047.1665691653665@office.mailbox.org
обсуждение исходный текст
Ответ на Re: Exponentiation confusion  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
> On 13/10/2022 19:16 CEST Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 
> Erik Wienhold <ewie@ewie.name> writes:
> > On 13/10/2022 18:20 CEST Adrian Klaver <adrian.klaver@aklaver.com> 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



В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: pg_upgrade to 15 fails on Windows because of xml_is_well_formed()
Следующее
От: Andrus
Дата:
Сообщение: How to return argument data type from sql function