Changeset: c8583e278a7d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c8583e278a7d
Modified Files:
        monetdb5/modules/mal/pp_algebra.c
Branch: default
Log Message:

Fix rounding of negative averages that are on the edge (i.e. -0.5).


diffs (12 lines):

diff --git a/monetdb5/modules/mal/pp_algebra.c 
b/monetdb5/modules/mal/pp_algebra.c
--- a/monetdb5/modules/mal/pp_algebra.c
+++ b/monetdb5/modules/mal/pp_algebra.c
@@ -308,7 +308,7 @@ mulmod(lng a, lng b, lng c)
 #else
 #define fix_avg(T, a, r, n)                                                    
                        \
        do {                                                                    
                                        \
-               if (!is_##T##_nil(a) && r > 0 && 2*r + (a < 0) >= n) {  \
+               if (!is_##T##_nil(a) && r > 0 && 2*r + (a >= 0) > n) {  \
                        a++;                                                    
                                        \
                        r -= n;                                                 
                                        \
                }                                                               
                                                \
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to