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

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: b6f0ad4) | patch
Re-implement division for numeric values using the traditional "schoolbook"
Fri, 4 Apr 2008 18:45:36 +0000 (18:45 +0000)
Fri, 4 Apr 2008 18:45:36 +0000 (18:45 +0000)
commit a0fad9762a22e739de69c85b51ff7a47e672732f
Re-implement division for numeric values using the traditional "schoolbook"
algorithm. This is a good deal slower than our old roundoff-error-prone
code for long inputs, so we keep the old code for use in the transcendental
functions, where everything is approximate anyway. Also create a
user-accessible function div(numeric, numeric) to provide access to the
exact result of trunc(x/y) --- since the regular numeric / operator will
round off its result, simply computing that expression in SQL doesn't
reliably give the desired answer. This fixes bug #3387 and various related
corner cases, and improves the usefulness of PG for high-precision integer
arithmetic.
doc/src/sgml/func.sgml diff | blob | blame | history
src/backend/utils/adt/numeric.c diff | blob | blame | history
src/include/catalog/catversion.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/test/regress/expected/numeric.out diff | blob | blame | history
src/test/regress/sql/numeric.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

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