Search Top Index
HELP INTOF Revised by A.Sloman Dec 1990 intof(<number:N>) -> <integer:I> If N is real (i.e. non-complex), -intof- truncates it to an integer, i.e. it returns the integer I of the same sign as N and with the largest magnitude such that abs(I) <= abs(N). If N is sufficiently large the result may be a biginteger. If N is a complex number, the result is the integral complex number obtained by applying -intof- to its parts, i.e. intof(realpart(N)) +: intof(imagpart(N)) Examples: intof(3.5444) => ** 3 intof(-3.544) => ** -3 sqrt(-3.7) => ** 0.0_+:1.92354 intof(3.6 + sqrt(-3.7)) => ** 3_+:1 intof(27/5) => ** 5 See also HELP * FRACOF See REF *NUMBERS for details of numbers and mathematical operations available in POP-11. See also HELP *DECIMALS - for the distinction between integers, decimals and ddecimals *MATH - for a summary of mathematical operations in POP-11 *EQUALS - for information about equality tests on numbers --- C.all/help/intof --------------------------------------------------- --- Copyright University of Sussex 1990. All rights reserved. ----------