summaryrefslogtreecommitdiff
path: root/strings/decimal.c
diff options
context:
space:
mode:
authorserg@serg.mylan <>2004-12-06 15:08:26 +0100
committerserg@serg.mylan <>2004-12-06 15:08:26 +0100
commitdc2e9d01d7b17d4d3a30cc03ec07b815cc2c7bf3 (patch)
tree9ef86be68820517e9e42844aeb1ffd17dcb76096 /strings/decimal.c
parent566b07074149f95a83b70d00e321f738374f6ee3 (diff)
downloadmariadb-git-dc2e9d01d7b17d4d3a30cc03ec07b815cc2c7bf3.tar.gz
int decimal_is_zero(decimal *from);
Diffstat (limited to 'strings/decimal.c')
-rw-r--r--strings/decimal.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/strings/decimal.c b/strings/decimal.c
index 6b2982d8d8f..2dcc2c88ceb 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -1240,6 +1240,16 @@ int decimal_cmp(decimal *from1, decimal *from2)
return from1->sign > from2->sign ? -1 : 1;
}
+int decimal_is_zero(decimal *from)
+{
+ dec1 *buf1=from->buf,
+ *end=buf1+ROUND_UP(from->intg)+ROUND_UP(from->frac);
+ while (buf1 < end)
+ if (*buf1++)
+ return 0;
+ return 1;
+}
+
/*
multiply two decimals