diff options
author | Andy Wingo <wingo@pobox.com> | 2011-01-23 00:06:24 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2011-01-23 00:06:24 +0100 |
commit | 8e43ed5d0bd035fae0ba106b245f03559cf529ec (patch) | |
tree | da95fa49df5c7520a99ab30b238c525f9ed7a128 /doc/ref/api-data.texi | |
parent | 0715410946949a8c6431b1661afbb03db8433697 (diff) | |
download | guile-8e43ed5d0bd035fae0ba106b245f03559cf529ec.tar.gz |
infinities are no longer integers
* libguile/numbers.c (scm_is_integer): Infinities are not integers, per
the R6RS.
(scm_even_p, scm_odd_p): Passing an infinity to even? or odd? is an
error.
* test-suite/tests/numbers.test ("integer?"): Adapt test.
("expt"): Add tests for +inf.0 and -inf.0 exponents.
* NEWS: Add NEWS entries.
Diffstat (limited to 'doc/ref/api-data.texi')
-rwxr-xr-x | doc/ref/api-data.texi | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/doc/ref/api-data.texi b/doc/ref/api-data.texi index 659dc5c0b..17b32bbd8 100755 --- a/doc/ref/api-data.texi +++ b/doc/ref/api-data.texi @@ -303,10 +303,6 @@ representation where the required number does not fit in the native form. Conversion between these two representations is automatic and completely invisible to the Scheme level programmer. -The infinities @samp{+inf.0} and @samp{-inf.0} are considered to be -inexact integers. They are explained in detail in the next section, -together with reals and rationals. - C has a host of different integer types, and Guile offers a host of functions to convert between them and the @code{SCM} representation. For example, a C @code{int} can be handled with @code{scm_to_int} and @@ -537,7 +533,8 @@ infinity, depending on the sign of the divided number. The infinities are written @samp{+inf.0} and @samp{-inf.0}, respectively. This syntax is also recognized by @code{read} as an -extension to the usual Scheme syntax. +extension to the usual Scheme syntax. The infinities are considered to +be inexact, non-integer values. Dividing zero by zero yields something that is not a number at all: @samp{+nan.0}. This is the special `not a number' value. @@ -548,9 +545,8 @@ are implemented using the corresponding @acronym{IEEE} 754 values. They behave in arithmetic operations like @acronym{IEEE} 754 describes it, i.e., @code{(= +nan.0 +nan.0)} @result{} @code{#f}. -The infinities are inexact integers and are considered to be both even -and odd. While @samp{+nan.0} is not @code{=} to itself, it is -@code{eqv?} to itself. +While @samp{+nan.0} is not @code{=} to itself, it is @code{eqv?} to +itself. To test for the special values, use the functions @code{inf?} and @code{nan?}. |