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

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 (view raw or flat)
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

pgsql-bugs by date

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

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