diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-08-13 21:47:02 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-08-13 21:47:02 -0700 |
commit | f2e197dcd31d737bf23816107343f67e2bf6dd8e (patch) | |
tree | ecdefacfe4177012fae54ae74d8c309eab336767 /txr.1 | |
parent | 4b308561021d4dedd7e83e5df30534d1fdde2216 (diff) | |
download | txr-f2e197dcd31d737bf23816107343f67e2bf6dd8e.tar.gz txr-f2e197dcd31d737bf23816107343f67e2bf6dd8e.tar.bz2 txr-f2e197dcd31d737bf23816107343f67e2bf6dd8e.zip |
New function, clamp.
* eval.c (eval_init): Register clamp as intrinsic function.
* lib.c (clamp): New function.
* lib.h (clamp): Declared.
* txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 38 |
1 files changed, 38 insertions, 0 deletions
@@ -23686,6 +23686,44 @@ Thus means .codn (max (max a b) c) . +.coNP Function @ clamp +.synb +.mets (clamp < low < high << val ) +.syne +.desc +The +.code clamp +function clamps value +.meta val +into the range +.meta low +to +.metn high . + +The +.code clamp +function returns +.meta low +if +.meta val +is less than +.metn low . +If +.meta val +is greater than or equal to +.metn low , +but less than +.metn high , +then it returns +.metn val . +Otherwise it returns +.meta high . + +More precisely, +.code (clamp a b c) +is equivalent to +.codn (max a (min b c)) . + .coNP Functions @, int-str @ flo-str and @ num-str .synb .mets (int-str < string <> [ radix ]) |