DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦09e38a237⟧ Ada Source

    Length: 7168 (0x1c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package Floating_Characteristics, seg_00eaf6

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



package Floating_Characteristics is
    --  This package is a floating mantissa definition of a binary FLOAT
    --  It was first used on the DEC-10 and the VAX but should work for any
    --  since the parameters are obtained by initializing on the actual hardware
    --  Otherwise the parameters could be set in the spec if known
    --  This is a preliminary package that defines the properties
    --  of the particular floating point type for which we are going to
    --  generate the math routines
    --  The constants are those required by the routines described in
    --  "Software Manual for the Elementary Functions" W. Cody & W. Waite
    --  Prentice-Hall 1980
    --  Actually most are needed only for the test programs
    --  rather than the functions themselves, but might as well be here
    --  Most of these could be in the form of attributes if
    --  all the floating types to be considered were those built into the
    --  compiler, but we also want to be able to support user defined types
    --  such as software floating types of greater precision than
    --  the hardware affords, or types defined on one machine to
    --  simulate another
    --  So we use the Cody-Waite names and derive them from an adaptation of the
    --  MACHAR routine as given by Cody-Waite in Appendix B
    --
    Ibeta : Integer;
    --  The radix of the floating-point representation
    --
    It : Integer;
    --  The number of base IBETA digits in the DIS_FLOAT significand
    --
    Irnd : Integer;
    --  TRUE (1) if floating addition rounds, FALSE (0) if truncates
    --
    Ngrd : Integer;
    --  Number of guard digits for multiplication
    --
    Machep : Integer;
    --  The largest negative integer such that
    --    1.0 + FLOAT(IBETA) ** MACHEP /= 1.0
    --  except that MACHEP is bounded below by -(IT + 3)
    --
    Negep : Integer;
    --  The largest negative integer such that
    --    1.0 -0 FLOAT(IBETA) ** NEGEP /= 1.0
    --  except that NEGEP is bounded below by -(IT + 3)
    --
    Iexp : Integer;
    --  The number of bits (decimal places if IBETA = 10)
    --  reserved for the representation of the exponent (including
    --  the bias or sign) of a floating-point number
    --
    Minexp : Integer;
    --  The largest in magnitude negative integer such that
    --  FLOAT(IBETA) ** MINEXP is a positive floating-point number
    --
    Maxexp : Integer;
    --  The largest positive exponent for a finite floating-point number
    --
    Eps : Float;
    --  The smallest positive floating-point number such that
    --                              1.0 + EPS /= 1.0
    --  In particular, if IBETA = 2 or IRND = 0,
    --  EPS = FLOAT(IBETA) ** MACHEP
    --  Otherwise, EPS = (FLOAT(IBETA) ** MACHEP) / 2
    --
    Epsneg : Float;
    --  A small positive floating-point number such that 1.0-EPSNEG /= 1.0
    --
    Xmin : Float;
    --  The smallest non-vanishing floating-point power of the radix
    --  In particular, XMIN = FLOAT(IBETA) ** MINEXP
    --
    Xmax : Float;
    --  The largest finite floating-point number

    --  Here the structure of the floating type is defined
    --  I have assumed that the exponent is always some integer form
    --  The mantissa can vary
    --  Most often it will be a fixed type or the same floating type
    --  depending on the most efficient machine implementation
    --  Most efficient implementation may require details of the machine hardware
    --  In this version the simplest representation is used
    --  The mantissa is extracted into a FLOAT and uses the predefined operations
    --
    subtype Exponent_Type is Integer;    --  should be derived  ##########
    subtype Mantissa_Type is Float;     --   range -1.0..1.0;
    --
    --  A consequence of the rigorous constraints on MANTISSA_TYPE is that
    --  operations must be very carefully examined to make sure that no number
    --  greater than one results
    --  Actually this limitation is important in constructing algorithms
    --  which will also run when MANTISSA_TYPE is a fixed point type

    --  If we are not using the STANDARD type, we have to define all the
    --  operations at this point
    --  We also need PUT for the type if it is not otherwise available

    --  Now we do something strange
    --  Since we do not know in the following routines whether the mantissa
    --  will be carried as a fixed or floating type, we have to make some
    --  provision for dividing by two
    --  We cannot use the literals, since FIXED/2.0 and FLOAT/2 will fail
    --  We define a type-dependent factor that will work
    --
    Mantissa_Divisor_2 : constant Float := 2.0;
    Mantissa_Divisor_3 : constant Float := 3.0;
    --
    --  This will work for the MANTISSA_TYPE defined above
    --  The alternative of defining an operation "/" to take care of it
    --  is too sweeping and would allow unAda-like errors
    --
    Mantissa_Half : constant Mantissa_Type := 0.5;

    procedure Defloat (X : in     Float;
                       N : in out Exponent_Type;
                       F : in out Mantissa_Type);

    procedure Refloat (N : in     Exponent_Type;
                       F : in     Mantissa_Type;
                       X : in out Float);
    --  Since the user may wish to define a floating type by some other name
    --  CONVERT_TO_FLOAT is used rather than just FLOAT for explicit coersion

    function Convert_To_Float (K : Integer) return Float;
    --  function CONVERT_TO_FLOAT(N : EXPONENT_TYPE) return FLOAT;

    function Convert_To_Float (F : Mantissa_Type) return Float;
end Floating_Characteristics;

E3 Meta Data

    nblk1=6
    nid=0
    hdr6=c
        [0x00] rec0=11 rec1=00 rec2=01 rec3=052
        [0x01] rec0=1a rec1=00 rec2=02 rec3=03a
        [0x02] rec0=1a rec1=00 rec2=03 rec3=02e
        [0x03] rec0=13 rec1=00 rec2=04 rec3=082
        [0x04] rec0=15 rec1=00 rec2=05 rec3=016
        [0x05] rec0=13 rec1=00 rec2=06 rec3=000
    tail 0x2170b5b7c822542701d96 0x42a00088462063203