next up previous contents
Next: Other arithmetic procedures Up: CHAPTER.5: NUMERICAL AND Previous: Recognizer predicates for

Coercing numbers from one type to another

number_coerce(NUM1, TO_NUM) -> NUM2
        Produces a number NUM2 which is the number NUM1 converted to the
        representation class  (i.e.  rational, single-float  decimal  or
        double-float ddecimal) of the number TO_NUM.

    number_coerce(3.5, 1) =>
    ** 7_/2

    number_coerce(3.5, 1_/2) =>
    ** 7_/2

    number_coerce(1_/2, 3.5) =>
    ** 0.5


Aaron Sloman
Fri Jan 2 03:17:44 GMT 1998