1 "  ******************************************************
 2 "  *                                                    *
 3 "  *                                                    *
 4 "  * Copyright (c) 1972 by Massachusetts Institute of   *
 5 "  * Technology and Honeywell Information Systems, Inc. *
 6 "  *                                                    *
 7 "  *                                                    *
 8 "  ******************************************************
 9 
10           name      round_
11           entry     round_
12 round_:
13           fld       ap|2,*    get high-order fl.pt. number.
14           tze       store     special case if zero.
15           lrs       72        mantissa = 0 if +, -2**(-71) if -.
16           adla      128,dl    add 2**(-28) to mantissa.
17           dfad      ap|2,*    round d.p. fl.pt. number.
18 store:    fst       ap|4,*    store rounded s.p. number.
19           short_return
20           entry     expon_
21 expon_:
22           lda       ap|2,*    get high-order fl.pt. number.
23           lrs       28        make exponent an integer.
24           qrl       8         then isolate high order mantissa.
25           stq       ap|2,*    store high-order mantissa.
26           sta       ap|4,*    store integer exponent.
27           short_return                  number = mantissa * 2**exponent.
28           entry     adexp_
29 adexp_:
30           lda       ap|2,*    get high-order fl.pt. number.
31           lrs       28        make exponent an integer.
32           adla      ap|4,*    add power to exponent.
33           lrs       8         attach high-order mantissa.
34           stq       ap|2,*    store high-order result:
35           short_return                  number * 2**power.
36           end
37 ^C^@