Thread: pgsql-server/src backend/utils/adt/int.c backe ...
pgsql-server/src backend/utils/adt/int.c backe ...
From
momjian@svr1.postgresql.org (Bruce Momjian)
Date:
CVSROOT: /cvsroot Module name: pgsql-server Changes by: momjian@svr1.postgresql.org 03/12/01 17:52:38 Modified files: src/backend/utils/adt: int.c int8.c numeric.c src/include/catalog: pg_operator.h pg_proc.h src/include/utils: builtins.h int8.h src/test/regress/expected: create_operator.out src/test/regress/sql: create_operator.sql Log message: 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