previous up next     contents index
Next: Characters Up: Programming Constructs Previous: Void and Undefined

Numbers

  A number in MzScheme is one of the following:

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:

    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.


previous up next     contents index
Next: Characters Up: Programming Constructs Previous: Void and Undefined

PLT