about summary refs log tree commit diff
path: root/Src/builtin.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/builtin.c')
-rw-r--r--Src/builtin.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index f9f65e961..530bba8c8 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -4759,13 +4759,14 @@ bin_ttyctl(char *name, char **argv, Options ops, int func)
 int
 bin_let(char *name, char **argv, Options ops, int func)
 {
-    zlong val = 0;
+    mnumber val = zero_mnumber;
 
     while (*argv)
-	val = mathevali(*argv++);
+	val = matheval(*argv++);
     /* Errors in math evaluation in let are non-fatal. */
     errflag = 0;
-    return !val;
+    /* should test for fabs(val.u.d) < epsilon? */
+    return (val.type == MN_INTEGER) ? val.u.l == 0 : val.u.d == 0.0;
 }
 
 /* umask command.  umask may be specified as octal digits, or in the  *