BUG #2356: sqrt and cbrt return different types

Поиск
Список
Период
Сортировка
От Philip Crotwell
Тема BUG #2356: sqrt and cbrt return different types
Дата
Msg-id 200603241655.k2OGtTKE059038@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #2356: sqrt and cbrt return different types  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      2356
Logged by:          Philip Crotwell
Email address:      crotwell@seis.sc.edu
PostgreSQL version: 8.1
Operating system:   linux
Description:        sqrt and cbrt return different types
Details:

The return of sqrt() is numeric but the return type of cbrt is double, which
is confusing. So, for example this works:
   select mod(sqrt(4.1), 4);
but this
   select mod(cbrt(4.1), 4);
fails with
ERROR:  function mod(double precision, integer) does not exist
and you have to do this instead:
   select mod(CAST (cbrt(4.1) AS NUMERIC), 4);

It seems to me that square root and cube root should be the same in return
type.

The docs should be updated if this change is made:
http://www.postgresql.org/docs/8.1/interactive/functions-math.html

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

Предыдущее
От: "Jaime Lara Alvarez"
Дата:
Сообщение: BUG #2355: Problem with INHERITS
Следующее
От: "Philip Crotwell"
Дата:
Сообщение: BUG #2357: docs for mod() are wrong