From d37c1cb86d573b53c4aff7f0f01c2bcccdee6651 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 10 Aug 2019 14:31:04 -0700 Subject: [PATCH] Add missing definition of exact as noticed by GJS. Also update the text of inexact and exact to match R7RS. --- doc/ref-manual/numbers.texi | 39 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/doc/ref-manual/numbers.texi b/doc/ref-manual/numbers.texi index ab13a002d..5cd2f88bd 100644 --- a/doc/ref-manual/numbers.texi +++ b/doc/ref-manual/numbers.texi @@ -1348,32 +1348,31 @@ throughout an implementation-dependent range. @deffn procedure inexact z @deffnx procedure exact->inexact z @code{inexact} returns an inexact representation of @var{z}. The -value returned is the inexact number that is numerically closest to the -argument. If an exact argument has no reasonably close inexact -equivalent, then a violation of an implementation restriction may be -reported; MIT/GNU Scheme signals an error of type -@code{condition-type:bad-range-argument} in this case. -@findex condition-type:bad-range-argument +value returned is the inexact number that is numerically closest to +the argument. For inexact arguments, the result is the same as the +argument. For exact complex numbers, the result is a complex number +whose real and imaginary parts are the result of applying +@code{inexact} to the real and imaginary parts of the argument, +respectively. If an exact argument has no reasonably close inexact +equivalent (in the sense of @code{=}), then a violation of an +implementation restriction may be reported. The procedure @code{exact->inexact} has been deprecated by @urseven{}. @end deffn -@deffn procedure inexact z -@deffnx procedure exact->inexact z -@code{inexact} returns an inexact representation of @var{z}. The -value returned is the inexact number that is numerically closest to the -argument. If an exact argument has no reasonably close inexact -equivalent, then a violation of an implementation restriction may be -reported; MIT/GNU Scheme signals an error of type -@code{condition-type:bad-range-argument} in this case. -@findex condition-type:bad-range-argument - +@deffn procedure exact z +@deffnx procedure inexact->exact z @code{exact} returns an exact representation of @var{z}. The value returned is the exact number that is numerically closest to the -argument. If an inexact argument has no reasonably close exact -equivalent, then a violation of an implementation restriction may be -reported; in MIT/GNU Scheme this case does not occur because all -inexact numbers are representable as exact numbers. +argument. For exact arguments, the result is the same as the +argument. For inexact non-integral real arguments, the implementation +may return a rational approximation, or may report an implementation +violation. For inexact complex arguments, the result is a complex +number whose real and imaginary parts are the result of applying +@code{exact} to the real and imaginary parts of the argument, +respectively. If an inexact argument has no reasonably close exact +equivalent (in the sense of @code{=}), then a violation of an +implementation restriction may be reported. The procedure @code{inexact->exact} has been deprecated by @urseven{}. @end deffn -- 2.25.1