From d4460c1b7c32e110fbc84839f248cbc3adb732f0 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Mon, 2 Apr 2018 12:59:37 +0000 Subject: [PATCH] fixed a bug and a wrong assertion in mul_nums() --- lib/number.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/number.c b/lib/number.c index 7f74891..e8575e9 100644 --- a/lib/number.c +++ b/lib/number.c @@ -216,12 +216,12 @@ static hcl_oop_t mul_nums (hcl_t* hcl, hcl_oop_t x, hcl_oop_t y, int mult) /* cs may be larger than HCL_SMOOI_MAX. but ns is guaranteed to be * equal to or less than HCL_SMOOI_MAX */ - HCL_ASSERT (hcl, ns > 0 && ns <= HCL_SMOOI_MAX); + HCL_ASSERT (hcl, ns <= HCL_SMOOI_MAX); nv = hcl_truncfpdecval(hcl, nv, cs, ns); if (!nv) return HCL_NULL; - return hcl_makefpdec(hcl, nv, ns); + return (ns <= 0)? nv: hcl_makefpdec(hcl, nv, ns); } hcl_oop_t hcl_mulnums (hcl_t* hcl, hcl_oop_t x, hcl_oop_t y)