summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-02-26 07:33:09 -0800
committerKaz Kylheku <kaz@kylheku.com>2017-02-26 07:33:09 -0800
commita66888b6e07dbfd6b22dcd7fa9e240692c17a039 (patch)
tree251e76409dbe78994bd4eb9ed4ea7237020bd47e /txr.1
parent0f32fe85728e4ee35a25094d99bdf7b3ff1630a7 (diff)
downloadtxr-a66888b6e07dbfd6b22dcd7fa9e240692c17a039.tar.gz
txr-a66888b6e07dbfd6b22dcd7fa9e240692c17a039.tar.bz2
txr-a66888b6e07dbfd6b22dcd7fa9e240692c17a039.zip
New floor-rem, ceil-rem and round-rem.
* arith.c (trunc_rem): Move function to below round function. Make second argument optional, defaulting to one. (floor_rem, ceil_rem, round_rem): New functions. * eval.c (eval_init): Registration of trunc-rem altered for optional argument. New registrations for floor-rem, ceil-rem, round=rem. * txr.1: Documented for new functions folded with trunc-rem.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.132
1 files changed, 23 insertions, 9 deletions
diff --git a/txr.1 b/txr.1
index 2045cf21..8a1e77ae 100644
--- a/txr.1
+++ b/txr.1
@@ -31902,25 +31902,39 @@ 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.
-.coNP Function @ trunc-rem
+.coNP Functions @, trunc-rem @, floor-rem @ ceil-rem and @ round-rem
.synb
-.mets (trunc-rem < dividend << divisor )
+.mets (trunc-rem < dividend <> [ divisor ])
+.mets (floor-rem < dividend <> [ divisor ])
+.mets (ceil-rem < dividend <> [ divisor ])
+.mets (round-rem < dividend <> [ divisor ])
.syne
.desc
-The
-.code trunc-rem
-function returns a list of two values: a
+These functions, respectively, perform the same division operation
+as
+.codn trunc ,
+.codn floor ,
+.codn ceil ,
+and
+.codn round ,
+referred to here as the respective target functions.
+
+If the
+.meta divisor
+is missing, it defaults to 1.
+
+Each 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.
+is exactly the same value as what would be returned by the
+respective target function for the same inputs.
+
The
.meta remainder
-obeys the following identity:
+value obeys the following identity:
.cblk
.mets (eql < remainder (- < dividend >> (* divisor << quotient )))