13.07.2015 Views

apple-pascal-1.3-manual

apple-pascal-1.3-manual

apple-pascal-1.3-manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ABS CROUND CX/Y))ABS C2-X>The ABS function does not accept long integer expressions.Exponential FunctionsApple Pascal provides three functions that return powers and roots ofnumerical values:SQR (X) PWROFTEN (X) SQRT (X)A fourth function, which returns powers of e (the base of naturallogarithms), is discussed below under "Logarithmic Functions."The SQR function accepts integer, integer subrange, and real expressions,creating an expression of the same type. It returns the square of theexpression's value. When used with integer and integer subrangeexpressions, if the result exceeds MAXINT (plus or minus 181 squared), thevalue returned is integer 0. When used with real expressions, if the resultexceeds 3.402823466e38 (plus or minus l.84467e19 squared), the programhalts with a floating-point error.The PWROFTEN function accepts any integer or integer subrangeexpression with a value in the range 0 .. 37, creating a real expression with avalue that is 10 to the power of that integer.The SQRT function accepts integer, integer subrange, and real expressionswith nonnegative values, creating an expression of the type real. The valuereturned is the square root. If the expression used with SQRT has a negativevalue, the program will halt with a floating-point error.Program Unit Required! The Program Unit TRANSCEND must bepresent in an accessible library at the time any program using the SQRTfunction is executed. You must also write the declaration us EsTRANSCEND; just after the program heading. TRANSCEND is originallysupplied in the file SYSTEM.LIBRARY. The USES declaration is furtherdescribed in Chapter 12; libraries are discussed in Chapter 13.Trigonometric FunctionsApple Pascal provides three trigonometric functions-sine, cosine, andarctangent-from which all other trigonometric functions can be derived byusing standard conversion formulas:SIN (X) COS (X) ATAN (X)Arithmetic OperationsIII-83

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!