diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-02-07 19:58:38 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-02-07 19:58:38 -0800 |
commit | 45fe65bb4305b896ac95bfa70c3273662e8e44f1 (patch) | |
tree | a925250b15d656980cc1c97ec26ec0620c7382df /txr.1 | |
parent | 91664c356f4eb1f31a90f36d369bceb386466f42 (diff) | |
download | txr-45fe65bb4305b896ac95bfa70c3273662e8e44f1.tar.gz txr-45fe65bb4305b896ac95bfa70c3273662e8e44f1.tar.bz2 txr-45fe65bb4305b896ac95bfa70c3273662e8e44f1.zip |
* arith.c (trunc_rem): New function.
* eval.c (eval_init): Register trunc-rem intrinsic.
* lib.h (trunc_rem): Declared.
* txr.1: Documented trunc-rem.
* tl.vim, txr.vim: Updated.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -18250,11 +18250,12 @@ A character may not be an operand of multiplication. .PP -.coNP Functions @, / @ trunc and @ mod +.coNP Functions @, / @ trunc, @ mod and @ trunc-rem .synb .mets (/ <> [ dividend ] << divisor ) .mets (trunc < dividend << divisor ) .mets (mod < dividend << divisor ) +.mets (trunc-rem < dividend << divisor ) .syne .desc The arguments to these functions are numbers. Characters are not permitted. @@ -18308,6 +18309,25 @@ then generalized into the floating point domain. For instance the expression yields a residue of 0.25 because 0.5 "goes into" 0.75 only once, with a "remainder" of 0.25. +The +.code trunc-rem +function returns a list of two values: a +.meta quotient +and a +.metn remainder. +The +.meta quotient +is exactly the same value as what +.code trunc +would return for the same inputs. +The +.meta remainder +obeys the following identity: + +.cblk +.mets (eql < remainder (- < dividend >> (* divisor << quotient ))) +.cble + .coNP Functions @ wrap and @ wrap* .synb .mets (wrap < start < end << number ) |