Skip site navigation (1) Skip section navigation (2)

Re: BUG #2356: sqrt and cbrt return different types

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Philip Crotwell" <crotwell(at)seis(dot)sc(dot)edu>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2356: sqrt and cbrt return different types
Date: 2006-03-24 21:35:52
Message-ID: 10690.1143236152@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Philip Crotwell" <crotwell(at)seis(dot)sc(dot)edu> writes:
> It seems to me that square root and cube root should be the same in return
> type.

They are, or at least one form of them matches:

regression=# \df sqrt
                     List of functions
   Schema   | Name | Result data type | Argument data types
------------+------+------------------+---------------------
 pg_catalog | sqrt | double precision | double precision
 pg_catalog | sqrt | numeric          | numeric
(2 rows)

regression=# \df cbrt
                     List of functions
   Schema   | Name | Result data type | Argument data types
------------+------+------------------+---------------------
 pg_catalog | cbrt | double precision | double precision
(1 row)


I think your request really amounts to "we should require every numeric
function to have a float8 counterpart and vice versa".  Life's a bit too
short for that, though.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2006-03-24 21:39:20
Subject: Re: BUG #2357: docs for mod() are wrong
Previous:From: Alvaro HerreraDate: 2006-03-24 21:35:39
Subject: Re: Error in ecpg

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group