From bab3d29fbab48e803e9dec09733a388aa1bbba22 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sat, 19 Oct 2002 02:08:19 +0000 Subject: This patch adds some missing functions for float8 math operations, specifically ceil(), floor(), and sign(). There may be other functions that need to be added, but this is a start. I've included some simple regression tests. Neil Conway --- src/backend/utils/adt/numeric.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/backend/utils/adt/numeric.c') diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numeric.c index 7f32e2e6243..f1967019d53 100644 --- a/src/backend/utils/adt/numeric.c +++ b/src/backend/utils/adt/numeric.c @@ -5,7 +5,7 @@ * * 1998 Jan Wieck * - * $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.55 2002/10/02 19:21:26 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.56 2002/10/19 02:08:17 momjian Exp $ * * ---------- */ @@ -425,7 +425,13 @@ numeric_uplus(PG_FUNCTION_ARGS) PG_RETURN_NUMERIC(res); } - +/* ---------- + * numeric_sign() - + * + * returns -1 if the argument is less than 0, 0 if the argument is equal + * to 0, and 1 if the argument is greater than zero. + * ---------- + */ Datum numeric_sign(PG_FUNCTION_ARGS) { -- cgit v1.2.3