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
|
| Список | 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 по дате отправления: