added many type checking predicates

This commit is contained in:
2018-04-07 04:43:56 +00:00
parent 726b8026b3
commit 54015185ab
3 changed files with 127 additions and 5 deletions

View File

@ -4048,7 +4048,12 @@ hcl_oop_t hcl_absint (hcl_t* hcl, hcl_oop_t x)
{
x = _clone_bigint(hcl, x, HCL_OBJ_GET_SIZE(x), HCL_BRAND_PBIGINT);
}
else if (!HCL_IS_PBIGINT(hcl, x))
else if (HCL_IS_PBIGINT(hcl, x))
{
/* do nothing. return x without change.
* [THINK] but do i need to clone a positive bigint? */
}
else
{
hcl_seterrbfmt (hcl, HCL_EINVAL, "parameter not integer - %O", x);
return HCL_NULL;