1 03/06/84  fortran hexadecimal mode
 2 
 3 This segment describes Fortran's hexadecimal mode and how it is used.
 4 
 5 
 6 Explanation of hexadecimal mode:
 7 
 8 A single word floating point number is represented on Multics as a
 9 signed 8-bit exponent followed by a signed 28 bit mantissa.  The value
10 of the number is normally the mantissa multiplied by the value of 2 to
11 the power of the exponent.  This gives a numerical range between
12 1.469E-39 and 1.701E+38 inclusive.  In hexadecimal mode, the value of
13 the number is the mantissa multiplied by the value of 16 to the power
14 of the exponent.  The range of hexadecimal numbers is between
15 1.864E-155 and 8.379E+152 inclusive.
16 
17 
18 Invoking hexadecimal mode for Fortran:
19 
20 The control argument "-hexadecimal_floating_point", or "-hfp" for
21 short, instructs the compiler to generate code that uses hexadecimal
22 floating point numbers.  This option can also be specified in the
23 source in a "%global" statement.  (e.g.  "%global hfp").  The default
24 option is "-binary_floating_point" or "bfp".
25 
26 This feature is only supported by the DPS8 hardware.  Compilations
27 using the "-hfp" control argument and the execution of any such
28 programs, requires "rw" access to >sc1>admin_acs>Fortran_hfp.acs.  This
29 segment must be created by site personnel if they wish to make use of
30 HFP.
31 
32 
33 Use of hexadecimal mode:
34 
35 Binary floating point numbers cannot be mixed with hexadecimal floating
36 point numbers.  The "hexadecimal_floating_point" option always applies
37 to the entire compilation unit.  Programs compiled in hexadecimal mode
38 differ from those compiled in binary mode only in their use of real,
39 complex and double precision numbers.  Integers are unaffected.
40 
41 
42 Pitfalls:
43 
44 If Fortran programs compiled in hexadecimal mode pass or receive
45 floating point arguments of Fortran programs compiled in binary mode,
46 the results are unpredictable.  Also, as Fortran is the only standard
47 Multics language that supports hexadecimal floating point arithmetic,
48 hexadecimal arguments cannot be reliably passed to any program compiled
49 in another language.
50 
51 In gaining the extra magnitude, hexadecimal numbers suffer from less
52 precision.  Generally, hexadecimal mode results in a loss of 3 bits of
53 reliable precision in the mantissas of floating point variables.