standardized call-out blocks
[rrq/rrqforth.git] / adoc / p_divmod.adoc
index bae6cbb0ef3fbfcea4324228057e743950004920..432e37926f3ce572a935dc8986f71d155a06d6fd 100644 (file)
@@ -1,9 +1,21 @@
+// math.asm:   WORD p_divmod,'/MOD',fasm
+
 anchor:p_divmod[]
 
-Word: /MOD
-----------
+=== Word: /MOD
+
+....
+Data stack: ( v1 v2 -- q r )
+....
+
+"/MOD" (div-mod) is a function word that replaces a pair of values
+with the results of signed integer division of the first, v1, divided
+by the second, v2. To that end, the values are 64-bit signed integers.
+The result is the integer quotient, q, and the remainder, r, where q
+and r are the respectively largest and smallest integers to satisfy
+the formula:
+....
+       v1 = q * v2 + r
+....
 
-----
-math.asm:      WORD p_divmod,'/MOD',fasm
-----