20 |
|
|
21 |
* Changes to Scheme functions and syntax |
* Changes to Scheme functions and syntax |
22 |
|
|
23 |
|
** There is support for Infinity and NaNs. |
24 |
|
|
25 |
|
Following PLT Scheme, Guile can now work with infinite numbers, and |
26 |
|
'not-a-numbers'. |
27 |
|
|
28 |
|
There is new syntax for numbers: "+inf.0" (infinity), "-inf.0" |
29 |
|
(negative infinity), "+nan.0" (not-a-number), and "-nan.0" (same as |
30 |
|
"+nan.0"). These numbers are inexact and have no exact counterpart. |
31 |
|
|
32 |
|
Dividing by an inexact zero returns +inf.0 or -inf.0, depending on the |
33 |
|
sign of the dividend. The infinities are integers, and they answer #t |
34 |
|
for both 'even?' and 'odd?'. The +nan.0 value is not an integer and is |
35 |
|
not '=' to itself, but '+nan.0' is 'eqv?' to itself. |
36 |
|
|
37 |
|
For example |
38 |
|
|
39 |
|
(/ 1 0.0) |
40 |
|
=> +inf.0 |
41 |
|
|
42 |
|
(/ 0 0.0) |
43 |
|
=> +nan.0 |
44 |
|
|
45 |
|
(/ 0) |
46 |
|
ERROR: Numerical overflow |
47 |
|
|
48 |
** We now have uninterned symbols. |
** We now have uninterned symbols. |
49 |
|
|
50 |
The new function 'make-symbol' will return a uninterned symbol. This |
The new function 'make-symbol' will return a uninterned symbol. This |