git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: af03663) | patch
Attached is a patch implementing factorial(), returning numeric. Points
Mon, 1 Dec 2003 21:52:38 +0000 (21:52 +0000)
Mon, 1 Dec 2003 21:52:38 +0000 (21:52 +0000)
commit 04a4821adef38155b7920ba9eb83c4c3c29156f8
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/backend/utils/adt/int.c diff | blob | blame | history
src/backend/utils/adt/int8.c diff | blob | blame | history
src/backend/utils/adt/numeric.c diff | blob | blame | history
src/include/catalog/pg_operator.h diff | blob | blame | history
src/include/catalog/pg_proc.h diff | blob | blame | history
src/include/utils/builtins.h diff | blob | blame | history
src/include/utils/int8.h diff | blob | blame | history
src/test/regress/expected/create_operator.out diff | blob | blame | history
src/test/regress/sql/create_operator.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /