diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-09-24 06:57:29 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-09-24 06:57:29 -0700 |
commit | 856c7188075a3e74ac4d9ef4dd665774f193d8d1 (patch) | |
tree | f981d3b4a23a763108d1590444fb56c8c4fae24f /txr.1 | |
parent | d510a260dd1755961fe85b6653e9832f49b34201 (diff) | |
download | txr-856c7188075a3e74ac4d9ef4dd665774f193d8d1.tar.gz txr-856c7188075a3e74ac4d9ef4dd665774f193d8d1.tar.bz2 txr-856c7188075a3e74ac4d9ef4dd665774f193d8d1.zip |
New functions: tofloatz and tointz.
* arith.c (tofloatz, tointz): New functions.
* arith.h (tofloatz, tointz): Declared.
* eval.c (eval_init): Register tofloatz and tointz intrinsics.
* txr.1: Documented new functions.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 43 |
1 files changed, 43 insertions, 0 deletions
@@ -29721,6 +29721,49 @@ Integers outside of this range are .code bignum integers. +.coNP Functions @ tofloatz and @ tointz +.synb +.mets (tofloatz << value ) +.mets (tointz < value <> [ radix ]) +.syne +.desc +These functions are closely related to, respectively, +.code tofloat +and +.codn toint . +They differ in that these functions return a floating-point +or integer zero, respectively, in some situations +in which those functions would return +.code nil +or throw an error. + +Whereas those functions reject a +.meta value +argument of +.codn nil , +for that same argument +.code tofloatz +function returns 0.0 and +.code tointz +returns 0. + +Likewise, in cases when +.code value +contains a string or character which cannot be +converted to a number, and +.code tofloat +and +.code toint +would return +.codn nil , +these functions return 0.0 and 0, respectively. + +In other situations, these functions behave +exactly like +.code tofloat +and +.codn toint . + .coNP Variables @, flo-min @ flo-max and @ flo-epsilon .desc These variables hold, respectively: the smallest positive floating-point |