Exponentiation confusion

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Exponentiation confusion
Дата
Msg-id 12a40226-70ac-3a3b-3d3a-fdaf9e32d312@aklaver.com
обсуждение исходный текст
Ответы Re: Exponentiation confusion  (Erik Wienhold <ewie@ewie.name>)
Re: Exponentiation confusion  ("Peter J. Holzer" <hjp-pgsql@hjp.at>)
Список pgsql-general
In trying to answer an SO question I ran across this:

Postgres version 14.5

select 10^(-1 * 18);
  ?column?
----------
     1e-18

select 10^(-1 * 18::numeric);
       ?column?
--------------------
  0.0000000000000000


Same for power:

select power(10, -18);
  power
-------
  1e-18
(1 row)

select power(10, -18::numeric);
        power
--------------------
  0.0000000000000000


Why is the cast throwing off the result?

-- 
Adrian Klaver
adrian.klaver@aklaver.com



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

Предыдущее
От: Rita
Дата:
Сообщение: Re: recovery.conf and archive files
Следующее
От: Erik Wienhold
Дата:
Сообщение: Re: Exponentiation confusion