
Next: Characters
Up: Programming Constructs
Previous: Void and Undefined
A number in MzScheme is one of the following:
- a fixnum integer (30
bits plus a sign bit) - a bignum integer (cannot be represented in a fixnum)
- a rational number
- a flonum (double-precision floating-point number)
- a complex number; the real and imaginary parts
are either both flonums or both rationals.
The first three number types are always exact. Flonums are always inexact.
A complex number is inexact if its real and imaginary parts are flonums,
otherwise it is exact.
The procedure add1 adds one to any number and sub1
subtracts one from any number.
In addition to the standard numerical procedures, the following
procedures work on exact integers:
- (bitwise-ior n
...n
)
returns the result of a bitwise ``or'' on the bitwise representations
of n
through n
in two's complement. - (bitwise-and n
...n
)
returns the result of a bitwise ``and'' on the bitwise representations
of n
through n
in two's complement. - (bitwise-xor n
...n
)
returns the result of a bitwise ``exclusive or'' on the bitwise
representations of n
through n
in two's complement. - (bitwise-not n)
returns the result of a bitwise ``not'' on the bitwise
representation of n in two's complement.
The following are inexact numerical constants: +inf.0
(infinity), -inf.0 (negative infinity), +nan.0
(not a number), and -nan.0 (not a number). They have no
exact form.
Standard procedures that take an integer index argument
(e.g. vector-ref) accept a fixnum argument or an integer flonum
argument whose exact translation is a fixnum. (Exceptions are
make-string and make-vector because the maximum size of a
string or vector may be smaller than the maximum size of a fixnum.) If
an argument any other type, the exn:application:type exception is raised.

Next: Characters
Up: Programming Constructs
Previous: Void and Undefined
PLT