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.

Some arithmetic operations using real data yield only approximate answers,as the results are rounded to fit the 32-bit format. Such rounding errors canbuild up, causing significant problems with chain calculations. It is a wiseprecaution to analyze your program carefully for this effect. The groundrules are set forth in Appendix 3B.Extended Arithmetic: To calculate large numbers precisely, use theApple II SANE (Standard Apple Numerics Environment) software. Askyour Apple dealer for details. To use SANE, you must be running the128K Pascal system.The Long Integer TypeApple Pascal long integers are signed whole numbers of up to 36 decimaldigits. They are calculated exactly, without rounding errors. Thus they areparticularly useful for business calculations where the amounts are toolarge for integer variables. If any intermediate or final result of long integercalculations exceeds a positive or negative 36-decimal-digit number,program execution halts with a run-time error.Program Unit Required! The Program Unit LONGINTIO must bepresent in an accessible library at the time any program using a longinteger variable is executed. LONGINTIO does not require a USESdeclaration, however. This Unit is originally supplied in the fileSYSTEM.LIBRARY. For further information about libraries, seeChapter 13.The long integer type is specified by the word INTEGER followed by alength attribute number in square brackets:INTEGERlengthattributeThe length attribute represents the maximum number of decimal digits thevariable can contain; it may be any whole number up to and including 36. Atypical long integer variable declaration looks like this:VAR POPULATION : INTEGER C 9 l ;This declaration tells Pascal that numbers stored in the variablePOPULATION may have up to nine decimal digits; that is, they may rangefrom -999,999,999 to +999,999,999.III-32Chapter 3: Simple Data Types

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

Saved successfully!

Ooh no, something went wrong!