doc clarifications on numbers

This commit is contained in:
Matthew Flatt 2011-02-01 07:59:49 -07:00
parent 0011b386ba
commit aed0980f1b

View File

@ -18,9 +18,9 @@
All @deftech{numbers} are @deftech{complex numbers}. Some of them are All @deftech{numbers} are @deftech{complex numbers}. Some of them are
@deftech{real numbers}, and all of the real numbers that can be @deftech{real numbers}, and all of the real numbers that can be
represented are also @deftech{rational numbers}, except for represented are also @deftech{rational numbers}, except for
@as-index{@racket[+inf.0]} and @as-index{@racket[+inf.f]} (positive @as-index{infinity}), @as-index{@racket[+inf.0]} (positive @as-index{infinity}), @as-index{@racket[+inf.f]} (single-precision variant),
@as-index{@racket[-inf.0]} an @as-index{@racket[-inf.f]} (negative infinity), and @as-index{@racket[-inf.0]} (negative infinity), @as-index{@racket[-inf.f]} (single-precision variant),
@as-index{@racket[+nan.0]} and @as-index{@racket[+nan.f]} (@as-index{not-a-number}). Among the @as-index{@racket[+nan.0]} (@as-index{not-a-number}), and @as-index{@racket[+nan.f]} (single-precision variant). Among the
rational numbers, some are @deftech{integers}, because @racket[round] rational numbers, some are @deftech{integers}, because @racket[round]
applied to the number produces the same number. applied to the number produces the same number.
@ -54,8 +54,8 @@ numbers). In particular, adding, multiplying, subtracting, and
dividing exact numbers always produces an exact result. dividing exact numbers always produces an exact result.
Inexact numbers can be coerced to exact form, except for the inexact Inexact numbers can be coerced to exact form, except for the inexact
numbers @racket[+inf.0] (double-precision), @racket[+inf.f] (single-precision), numbers @racket[+inf.0], @racket[+inf.f],
@racket[-inf.0], @racket[-inf.f], @racket[+nan.0], and @racket[+nan.f] which @racket[-inf.0], @racket[-inf.f], @racket[+nan.0], and @racket[+nan.f], which
have no exact form. @index["division by inexact zero"]{Dividing} a have no exact form. @index["division by inexact zero"]{Dividing} a
number by exact zero raises an exception; dividing a non-zero number number by exact zero raises an exception; dividing a non-zero number
other than @racket[+nan.0] or @racket[+nan.f] by an inexact zero returns @racket[+inf.0], other than @racket[+nan.0] or @racket[+nan.f] by an inexact zero returns @racket[+inf.0],
@ -65,14 +65,14 @@ or @racket[-inf.f], depending on the sign and precision of the dividend. The
is @racket[eqv?] to itself, and @racket[+nan.f] is similarly @racket[eqv?] but is @racket[eqv?] to itself, and @racket[+nan.f] is similarly @racket[eqv?] but
not @racket[=] to itself. Conversely, @racket[(= 0.0 -0.0)] is not @racket[=] to itself. Conversely, @racket[(= 0.0 -0.0)] is
@racket[#t], but @racket[(eqv? 0.0 -0.0)] is @racket[#f], and the @racket[#t], but @racket[(eqv? 0.0 -0.0)] is @racket[#f], and the
same for @racket[0.0f0] and @racket[-0.0f0]. The datum same for @racket[0.0f0] and @racket[-0.0f0] (which are single-precision variants). The datum
@racketvalfont{-nan.0} refers to the same constant as @racket[+nan.0], @racketvalfont{-nan.0} refers to the same constant as @racket[+nan.0],
and @racketvalfont{-nan.f} is the same as @racket[+nan.f], and @racketvalfont{-nan.f} is the same as @racket[+nan.f].
Calculations with infinites produce results consistent with IEEE Calculations with infinites produce results consistent with IEEE
double-precision floating point where IEEE specifies the result; in double- or single-precision floating point where IEEE specifies the result; in
cases where IEEE provides no specification (e.g., @racket[(angle cases where IEEE provides no specification, such as @racket[(angle
+inf.0+inf.0i)]), the result corresponds to the limit approaching +inf.0+inf.0i)], the result corresponds to the limit approaching
infinity, or @racket[+nan.0] or @racket[+nan.f] if no such limit exists. infinity, or @racket[+nan.0] or @racket[+nan.f] if no such limit exists.
A @deftech{fixnum} is an exact integer whose two's complement A @deftech{fixnum} is an exact integer whose two's complement