aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/builtin.c b/builtin.c
index f92e0cae..0afeb944 100644
--- a/builtin.c
+++ b/builtin.c
@@ -4305,7 +4305,10 @@ do_typeof(int nargs)
}
break;
case Node_val:
- switch (fixtype(arg)->flags & (STRING|NUMBER|USER_INPUT|REGEX)) {
+ switch (fixtype(arg)->flags & (STRING|NUMBER|USER_INPUT|REGEX|BOOL)) {
+ case NUMBER|BOOL:
+ res = "number|bool";
+ break;
case NUMBER:
res = "number";
break;
@@ -4492,7 +4495,7 @@ format_nan_inf(NODE *n, char format)
goto fmt;
} else if (mpfr_inf_p(n->mpg_numbr)) {
- strcpy(buf, mpfr_sgn(n->mpg_numbr) < 0 ? "-inf" : "+inf");
+ strcpy(buf, mpfr_signbit(n->mpg_numbr) ? "-inf" : "+inf");
goto fmt;
} else
@@ -4537,6 +4540,21 @@ check_symtab_functab(NODE *dest, const char *fname, const char *msg)
fatal(msg, fname, "FUNCTAB");
}
+/* do_mkbool --- create boolean values */
+
+NODE *
+do_mkbool(int nargs)
+{
+ NODE *tmp;
+ bool result;
+
+ tmp = POP_SCALAR();
+ result = boolval(tmp);
+ DEREF(tmp);
+
+ return make_bool_node(result);
+}
+
/* reverse --- reverse the contents of a string in place */
static void