pgsql: Re-implement division for numeric values using the traditional

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: Re-implement division for numeric values using the traditional
Дата
Msg-id 20080404184536.EABF17558E8@cvs.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Log Message:
-----------
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.

Modified Files:
--------------
    pgsql/doc/src/sgml:
        func.sgml (r1.426 -> r1.427)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/func.sgml?r1=1.426&r2=1.427)
    pgsql/src/backend/utils/adt:
        numeric.c (r1.108 -> r1.109)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/numeric.c?r1=1.108&r2=1.109)
    pgsql/src/include/catalog:
        catversion.h (r1.444 -> r1.445)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/catversion.h?r1=1.444&r2=1.445)
        pg_proc.h (r1.486 -> r1.487)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_proc.h?r1=1.486&r2=1.487)
    pgsql/src/include/utils:
        builtins.h (r1.311 -> r1.312)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/builtins.h?r1=1.311&r2=1.312)
    pgsql/src/test/regress/expected:
        numeric.out (r1.21 -> r1.22)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/numeric.out?r1=1.21&r2=1.22)
    pgsql/src/test/regress/sql:
        numeric.sql (r1.14 -> r1.15)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/numeric.sql?r1=1.14&r2=1.15)

В списке pgsql-committers по дате отправления:

Предыдущее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Remove no-longer-used function assign_backslash_quote()
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: pgsql: Remove no-longer-used function assign_backslash_quote()