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.

Output: Binary to DecimalFor writing real values, WRITE statements take parameters of three forms:REXP:El REXP:El:E2 REXPwhere REXP is an expression of type REAL, and El and E2 are expressionsof type INTEGER. El is called the width expression, and gives a minimumnumber of characters to be written. E2 is called the decimal placesexpression, and asks for a specific number of digits to appear to the right ofthe decimal point.REXP:El asks for the value REXP to be written as- x.xxxxxxxE+ yyIn this "floating" form, the signs will vary, but the form will always includeone digit to the left of the point and a two-digit exponent with a sign. Thevalue of REXP is rounded to the number of digits needed to fill up the fieldwidth given by El.REXP:El:E2 asks for the valueREXP to be written asbbbbb-xxxx.yyyIn this "fixed-point" form, there is no exponent, and the value REXP isrounded to E2 decimal places to the right of the point. The number of digitsto the left of the decimal point are implied by the magnitude of REXP.Enough blanks are padded on the left to fill out the field width given by El.If the width El is insufficient, it is ignored and as many characters arewritten as are needed to represent the value of REXP with E2 decimalplaces.The parameter REXP (without El and E2) asks for the default "floating"form with El set to 12. This form gives 6 significant digits of precision.Messy Details: If E2 is missing, any El less than 8 is increased to 8. IfE2 is present, any El less than E2 + 3 is increased to E2 + 3. Then, if Elis greater than 80, El is decreased to 80, and if E2 is present, it isdecreased by an equal amount.A zero value is always written 0. 0, regardless of El and E2. It is paddedwith blanks left and right to fill the given field width and to keep its decimalpoint aligned with those of other values written with the same WRITEparameters.AccuracyIII-319

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

Saved successfully!

Ooh no, something went wrong!