BUG #2356: sqrt and cbrt return different types

From: "Philip Crotwell" <crotwell(at)seis(dot)sc(dot)edu>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2356: sqrt and cbrt return different types
Date: 2006-03-24 16:55:29
Message-ID: 200603241655.k2OGtTKE059038@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 2356
Logged by: Philip Crotwell
Email address: crotwell(at)seis(dot)sc(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Philip Crotwell 2006-03-24 17:00:44 BUG #2357: docs for mod() are wrong
Previous Message Jim C. Nasby 2006-03-24 14:45:29 Re: Nightly builds