Search                        Top                                  Index
HELP FRACOF                            Revised by Aaron Sloman, Dec 1990

    fracof(<number:N>) -> <number:D>

FRACOF, given a real number as an argument, returns the fractional part
of that number, defined thus:

    fracof(N) = N - intof(N)

(See HELP * INTOF).

If N is a decimal D will be a decimal; if N is a ddecimal it will be a
ddecimal. If N is negative, then D is negative:

    fracof(-3.333) =>
    ** -0.333


If N is an integer D will be 0. If N is a ratio then D will be a ratio,
and the calculation will be EXACT. E.g.

    fracof(22/7) =>
    ** 1_/7

If N is complex the real and imaginary parts are dealt with separately:

    3.7 + sqrt(-2.5) =>
    ** 3.7_+:1.581139

    fracof(3.7 + sqrt(-2.5)) =>
    ** 0.7_+:0.581139

See Also

HELP * INTOF

REF * NUMBERS
    for details of numbers and mathematical operations available in
    POP-11.

HELP * DECIMALS
    for the distinction between integers, decimals and ddecimals

HELP * MATH
    for a summary of mathematical operations in POP-11

HELP * EQUAL
    for information about comparing numbers using "=" and "=="


--- C.all/help/fracof --------------------------------------------------
--- Copyright University of Sussex 1990. All rights reserved. ----------