DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: ┃ T V ┃
Length: 5618 (0x15f2) Types: TextFile Names: »V«
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11 └─ ⟦129cab021⟧ »DATA« └─⟦9b477e385⟧ └─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16 └─ ⟦6f12a12be⟧ »DATA« └─⟦9b477e385⟧ └─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04 └─ ⟦d65440be7⟧ »DATA« └─⟦9b477e385⟧ └─⟦this⟧
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;