Imp80: %routine WRITE(%integer I, J) This routine transmits the value of the integer expression I to the currently selected output stream. The second parameter specifies the number of positions to be used. To simplify the alignment of positive and negative numbers, an additional position is allowed for a sign, but the sign is only printed in the case of negative numbers. If the number to be printed needs more positions than are specified by the second parameter, then more positions are used. Examples: WRITE(I, 4) WRITE(TOTAL+SUM+ROW(I), 6) WRITE(SNAP, POS+4) {IMP77: the total number of print positions to be used is defined by the modulus of the second parameter. If this parameter is negative, no space character is output before a positive value.} %routine PRINT(%long %real X, %integer I, J) This routine transmits to the currently selected output stream the value of the real expression specified by the first parameter. The second and third parameters should be integer expressions specifying the number of places to be allowed before and after the decimal point. If the integer part needs more positions than are specified by the parameter, then more positions will be taken. One position is allowed for a sign which is printed only in the negative case. If necessary, the fractional part will be rounded. Examples: PRINT(A, 2, 3) PRINT(COS(A-B), 1, 10) {IMP77: The second parameter is interpreted in the same way as the second parameter of WRITE (described above).} %routine PRINT FL(%longreal X, %integer I) This routine transmits to the currently selected output stream the value of the real expression specified by the first parameter. The second parameter specifies the number of places to be allowed after the decimal point. The printed number takes up the specified number of places, plus 7 additional places. Example: PRINT FL(X,4) If X has the value 17.63584, this would be printed as 1.7636@ 1. The number is standardised in the range 1 <= X < 10. One position each is allowed for signs for mantissa and exponent; in each case the sign is only printed when negative. Imp: %routine PRINT FL(%longreal X, %integer I) This routine transmits to the currently selected output stream the value of the real expression specified by the first parameter. The second parameter specifies the number of places to be allowed after the decimal point. The printed number takes up the specified number of places, plus 7 additional places. Example: PRINT FL(X,4) If X has the value 17.63584, this would be printed as 1.7636@ 1. The number is standardised in the range 1 <= X < 10. One position each is allowed for signs for mantissa and exponent; in each case the sign is only printed when negative. AA: The routines for the output of a single decimal number are %routine spec print fl (%real x, %integer m) %routine spec print (%real x, %integer m,n) The first of these prints the value of x (which may of course be a general [EXPR]) in floating point form, standardised in the range 1 <= x < 10, with m decimal digits after the decimal point. The number is preceded by a minus sign if negative, and a space if positive. The exponent is preceded by @ and consists of a space or a minus sign and two decimal digits, the first of which is replaced by a space if it is not significant. The second routine prints the value of x in fixed point form with m digits before the decimal point and n after. Non-significant zeros, other than one immediately before the decimal point, are suppressed, and a minus sign or space precedes the first digit printed. If |x| >= 10^m then extra digits are included before the decimal point, the effect being to spoil any vertical alignment of the printed page. It should be noted that no terminating characters are included by the above routines.