summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-10-08 00:46:10 +0200
committerSergei Golubchik <sergii@pisem.net>2014-10-08 00:46:10 +0200
commit104771de9a6fe9ef1b02224d0c1a81178a326121 (patch)
tree085506f6413083d5322c4430b61f2ec71de50630 /strings
parentc1a4f0c5ab4ceef28900c1bd0a899ccad5725d8b (diff)
downloadmariadb-git-104771de9a6fe9ef1b02224d0c1a81178a326121.tar.gz
decimal: *correct* implementation of ROUND_UP at last
Diffstat (limited to 'strings')
-rw-r--r--strings/decimal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/strings/decimal.c b/strings/decimal.c
index 8d6877a24ec..07ccc537e47 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -137,7 +137,7 @@ static const dec1 frac_max[DIG_PER_DEC1-1]={
static inline int ROUND_UP(int x)
{
- return (x + (x > 0 ? 1 : -1) * (DIG_PER_DEC1 - 1)) / DIG_PER_DEC1;
+ return (x + (x > 0 ? DIG_PER_DEC1 - 1 : 0)) / DIG_PER_DEC1;
}
#ifdef HAVE_valgrind