summaryrefslogtreecommitdiff
path: root/doc/ref/scheme-data.texi
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2003-05-03 22:45:49 +0000
committerKevin Ryde <user42@zip.com.au>2003-05-03 22:45:49 +0000
commit016668fa788e0c048c82d29d938c396e888d2e8d (patch)
tree1152ee9cdff825d87410aabfdc9c08d2cdb64f4f /doc/ref/scheme-data.texi
parentb5aa02152352d758c13df68dd7f4a43784ce265f (diff)
downloadguile-016668fa788e0c048c82d29d938c396e888d2e8d.tar.gz
(Integer Operations): Describe how quotient,
remainder and modulo round their results.
Diffstat (limited to 'doc/ref/scheme-data.texi')
-rwxr-xr-xdoc/ref/scheme-data.texi21
1 files changed, 13 insertions, 8 deletions
diff --git a/doc/ref/scheme-data.texi b/doc/ref/scheme-data.texi
index 125592df8..b6bcc2c28 100755
--- a/doc/ref/scheme-data.texi
+++ b/doc/ref/scheme-data.texi
@@ -554,13 +554,14 @@ otherwise.
@end deffn
@c begin (texi-doc-string "guile" "quotient")
-@deffn {Scheme Procedure} quotient
-Return the quotient of the numbers @var{x} and @var{y}.
-@end deffn
-
@c begin (texi-doc-string "guile" "remainder")
-@deffn {Scheme Procedure} remainder
-Return the remainder of the numbers @var{x} and @var{y}.
+@deffn {Scheme Procedure} quotient n d
+@deffnx {Scheme Procedure} remainder n d
+Return the quotient or remainder from @var{n} divided by @var{d}. The
+quotient is rounded towards zero, and the remainder will have the same
+sign as @var{n}. In all cases quotient and remainder satisfy
+@math{@var{n} = @var{q}*@var{d} + @var{r}}.
+
@lisp
(remainder 13 4) @result{} 1
(remainder -13 4) @result{} -1
@@ -568,11 +569,15 @@ Return the remainder of the numbers @var{x} and @var{y}.
@end deffn
@c begin (texi-doc-string "guile" "modulo")
-@deffn {Scheme Procedure} modulo
-Return the modulo of the numbers @var{x} and @var{y}.
+@deffn {Scheme Procedure} modulo n d
+Return the remainder from @var{n} divided by @var{d}, with the same
+sign as @var{d}.
+
@lisp
(modulo 13 4) @result{} 1
(modulo -13 4) @result{} 3
+(modulo 13 -4) @result{} -3
+(modulo -13 -4) @result{} -1
@end lisp
@end deffn