From 04a4821adef38155b7920ba9eb83c4c3c29156f8 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Mon, 1 Dec 2003 21:52:38 +0000 Subject: Attached is a patch implementing factorial(), returning numeric. Points to note: 1) arttype is numeric. I thought this was the best way of allowing arbitarily large factorials, even though factorial(2^63) is a large number. Happy to change to integers if this is overkill. 2) since we're accepting numeric arguments, the patch tests for floats. If a numeric is passed with non-zero decimal portion, an error is raised since (from memory) they are undefined. Gavin Sherry --- src/include/utils/int8.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/include/utils/int8.h') diff --git a/src/include/utils/int8.h b/src/include/utils/int8.h index aad610eb9ee..7fe9800b235 100644 --- a/src/include/utils/int8.h +++ b/src/include/utils/int8.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/int8.h,v 1.39 2003/11/29 22:41:15 pgsql Exp $ + * $PostgreSQL: pgsql/src/include/utils/int8.h,v 1.40 2003/12/01 21:52:38 momjian Exp $ * * NOTES * These data types are supported on all 64-bit architectures, and may @@ -72,7 +72,6 @@ extern Datum int8mi(PG_FUNCTION_ARGS); extern Datum int8mul(PG_FUNCTION_ARGS); extern Datum int8div(PG_FUNCTION_ARGS); extern Datum int8abs(PG_FUNCTION_ARGS); -extern Datum int8fac(PG_FUNCTION_ARGS); extern Datum int8mod(PG_FUNCTION_ARGS); extern Datum int8inc(PG_FUNCTION_ARGS); extern Datum int8larger(PG_FUNCTION_ARGS); -- cgit v1.2.3