]> granicus.if.org Git - postgresql/commit
Fix NUMERIC modulus to properly truncate division in computation.
authorBruce Momjian <bruce@momjian.us>
Sat, 4 Jun 2005 14:12:50 +0000 (14:12 +0000)
committerBruce Momjian <bruce@momjian.us>
Sat, 4 Jun 2005 14:12:50 +0000 (14:12 +0000)
commit1bc92352246901eacbbe94e2dbcfb680116f1979
treee938482b7425186cc52c607e1cc9ab91999de1aa
parenta76606454cba15f85d6bcbc9c73e364cf6a346c5
Fix NUMERIC modulus to properly truncate division in computation.
Division rounding was causing incorrect results.  Test case:

test=> SELECT 12345678901234567890 % 123;
 ?column?
----------
       78
(1 row)

Was returning -45.
src/backend/utils/adt/numeric.c