DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T V

⟦9b9a6cb60⟧ TextFile

    Length: 3319 (0xcf7)
    Types: TextFile
    Names: »V«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile

with Universal_Integer_Arithmetic;
use Universal_Integer_Arithmetic;
package Universal_Real_Arithmetic is

    --  This package implements the Ada type Universal_real.

    --  The operations defined on universal numbers are those specified in
    --  chapter 4 of the RM.  Since the equality and inequality operators can
    --  not be overloaded, an equality function is defined.   A universal real
    --  number corresponds to a unique pair of universal integers that represent
    --  it as a rational number.  A function, UR, is defined that constructs a
    --  universal real number from a pair of universal integers.  Also, the inverse
    --  of this function is provided by two functions, NUMERATOR and DENOMINATOR,
    --  that decompose the rational number representation of their universal real
    --  argument into its numerator and denominator, respectively. In addition,
    --  conversions between Universal_integer and Universal_real are defined.


    type Universal_Real is private;


    function "+" (X, Y : Universal_Real) return Universal_Real;
    function "-" (X, Y : Universal_Real) return Universal_Real;
    function "*" (X, Y : Universal_Real) return Universal_Real;
    function "/" (X, Y : Universal_Real) return Universal_Real;

    function "**" (X : Universal_Real; Y : Integer) return Universal_Real;

    function "*" (X : Universal_Integer; Y : Universal_Real)
                 return Universal_Real;
    function "*" (X : Universal_Real; Y : Universal_Integer)
                 return Universal_Real;
    function "/" (X : Universal_Real; Y : Universal_Integer)
                 return Universal_Real;

    function "-" (X : Universal_Real) return Universal_Real;
    function "abs" (X : Universal_Real) return Universal_Real;

    function ">=" (X, Y : Universal_Real) return Boolean;
    function ">" (X, Y : Universal_Real) return Boolean;
    function "<=" (X, Y : Universal_Real) return Boolean;
    function "<" (X, Y : Universal_Real) return Boolean;
    function Eql (X, Y : Universal_Real) return Boolean;


    function Ui (X : Universal_Real) return Universal_Integer;

    -- Converts a universal real to a universal integer by rounding.


    function Ur (X : Universal_Integer) return Universal_Real;

    -- Converts a universal integer to a universal real.


    function Ur (N, D : Universal_Integer) return Universal_Real;

    -- Constructs a universal real as the ratio of  two universal integers.
    -- The value of d must not be ZERO; if it is, NUMERIC_ERROR is raised.


    function Numerator (X : Universal_Real) return Universal_Integer;

    -- Returns the numerator of x viewed as a rational number.


    function Denominator (X : Universal_Real) return Universal_Integer;

    -- Returns the denominator of x viewed as a rational number.


private

    --  A universal real is represented as a rational number consisting
    --  of a pair of universal integers.  The numerator is the first
    --  member of the pair and the denominator is the second.  The
    --  denominator must not be zero.  Also, the numerator, denominator
    --  pair is always reduced to lowest terms.

    type Universal_Real is
        record
            Num : Universal_Integer;
            Den : Universal_Integer;
        end record;


end Universal_Real_Arithmetic;