summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index 21cfb68c..0062ac94 100644
--- a/lib.c
+++ b/lib.c
@@ -832,6 +832,20 @@ val bignump(val num)
return (is_ptr(num) && type(num) == BGNUM) ? t : nil;
}
+val numberp(val num)
+{
+ switch (tag(num)) {
+ case TAG_NUM:
+ return t;
+ case TAG_PTR:
+ if (num->t.type == BGNUM)
+ return t;
+ /* fallthrough */
+ default:
+ return nil;
+ }
+}
+
val plusv(val nlist)
{
if (!nlist)