summaryrefslogtreecommitdiffstats
path: root/stream.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-11-07 06:05:13 -0800
committerKaz Kylheku <kaz@kylheku.com>2018-11-07 06:05:13 -0800
commit6fdad9e0389cb51b5822fda2920f510cb9a8881a (patch)
tree8b0053b4d4d810f13f3f5677632cb0b0caed9170 /stream.c
parentf94626c565cbe25773d680c6adf518b8570b8170 (diff)
downloadtxr-6fdad9e0389cb51b5822fda2920f510cb9a8881a.tar.gz
txr-6fdad9e0389cb51b5822fda2920f510cb9a8881a.tar.bz2
txr-6fdad9e0389cb51b5822fda2920f510cb9a8881a.zip
math: improve error diagnosis.
More streamlined code, better identification of functions. * arith.c (not_number, not_integer, invalid_ops, invalid_op, divzero): New static functions. (num_to_buffer, bugnum_len, plus, minus, neg, abso, signum, mul, trunc1, mod, floordiv, round1, roundiv, divi, zerop, plusp, minusp, evenp, oddp, gt, lt, ge, le, numeq, expt, exptmod, floorf, ceili, sine, cosi, tang, asine, acosi, atang, loga, logten, logtwo, expo, sqroot, int_flo, flo_int, cum_norm_dist, inv_cum_norm): Establish function's Lisp name as self variable. Use new static functions for reporting common errors. Pass function name to new argument of c_flo function. * buf.c (buf_put_float, buf_put_double): Pass function's Lisp name to c_flo function. * ffi.c (ffi_float_put, ffi_double_put): Likewise. * lib.c (c_flo): Takes new argument, name of calling function. * lib.h (c_flo): Declaration updated. * stream.c (formatv): Pass function name to c_flo.
Diffstat (limited to 'stream.c')
-rw-r--r--stream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/stream.c b/stream.c
index 69c891bf..9d67745f 100644
--- a/stream.c
+++ b/stream.c
@@ -3232,7 +3232,7 @@ val formatv(val stream_in, val fmtstr, struct args *al)
obj = flo_int(obj);
/* fallthrough */
case FLNUM:
- n = c_flo(obj);
+ n = c_flo(obj, lit("format"));
break;
case NUM:
n = convert(double, c_num(obj));