[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2.1 Number classes

Builtin Class: <number>
Builtin Class: <complex>
Builtin Class: <real>
Builtin Class: <integer>
These classes consist a class hierarchy of number objects. <complex> inherits <number>, <real> inherits <complex> and <integer> inherits <real>.

Note that these classes does not exactly corresponds to the number hierarchy defined in R5RS. Especially, only exact integers are the instances of the <integer> class. That is,
 
(integer? 1)        => #t
(is-a? 1 <integer>) => #t
(is-a? 1 <real>)    => #t

(integer? 1.0)        => #t
(is-a? 1.0 <integer>) => #f
(is-a? 1.0 <real>)    => #t

(class-of (expt 2 100)) => #<class <integer>>
(class-of (sqrt -3)) => #<class <complex>>



This document was generated by Ken Dickey on November, 28 2002 using texi2html