BUG #2357: docs for mod() are wrong

From: "Philip Crotwell" <crotwell(at)seis(dot)sc(dot)edu>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2357: docs for mod() are wrong
Date: 2006-03-24 17:00:44
Message-ID: 200603241700.k2OH0iYM059116@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: 2357
Logged by: Philip Crotwell
Email address: crotwell(at)seis(dot)sc(dot)edu
PostgreSQL version: 8.1
Operating system: linux
Description: docs for mod() are wrong
Details:

The docs for mod() say that the return type is "(same as argument types)"
which would seem to indicate that you could call mod() with doubles.
However, mod() with double arguments gives this error:
ERROR: function mod(double precision, integer) does not exist

For example:
select mod(degrees(1), 1);
ERROR: function mod(double precision, integer) does not exist
HINT: No function matches the given name and argument types. You may need
to add explicit type casts.

It would be nice if mod could directly take a double, but if not the docs
should say that the arguments should be NUMERIC and you must cast, for
example this works:
select mod(CAST (degrees(1) AS NUMERIC), 1);

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Magnus Hagander 2006-03-24 18:15:43 Re: BUG #2343: Silent installers fails
Previous Message Philip Crotwell 2006-03-24 16:55:29 BUG #2356: sqrt and cbrt return different types