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

⟦25ba19b87⟧ Ada Source

    Length: 3072 (0xc00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Ptr_Complexe, seg_0476b7

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



with Text_Io;
package body Ptr_Complexe is

    type Complex is
        record
            R : Real;
            I : Real;
        end record;
    package Io_Real is new Io.Float_Io (Real);


    function "+" (Operande_1, Operande_2 : in Object) return Object is
        Result : Object;
    begin  
        Result := new Complex;
        if (Operande_1 = Null_Object) or (Operande_2 = Null_Object) then
            raise Object_Inexistant;
        end if;
        Result.all.R := Operande_1.all.R + Operande_2.all.R;
        Result.all.I := Operande_1.all.I + Operande_2.all.I;
        return Result;
    end "+";

    function "-" (Operande_1, Operande_2 : in Object) return Object is
        Result : Object;
    begin
        Result := new Complex;
        if (Operande_1 = Null_Object) or (Operande_2 = Null_Object) then
            raise Object_Inexistant;
        end if;
        Result.all.R := Operande_1.all.R - Operande_2.all.R;
        Result.all.I := Operande_1.all.I - Operande_2.all.I;
        return Result;  
    end "-";

    function "*" (Operande_1, Operande_2 : in Object) return Object is
    begin
        [statement]
    end "*";

    procedure Print (Obj : in Object) is
    begin
        if (Obj = Null_Object) then  
            raise Object_Inexistant;
        end if;
        Text_Io.Put_Line ("le nbr complexe est :");
        Io_Real.Put (Obj.all.R);
        Text_Io.Put ("+");
        Io_Real.Put (Obj.all.I);
    end Print;

    procedure Create (Obj : in out Object; Real_Part, Imaginary_Part : Real) is
    begin
        Obj := new Complex;
        Obj.all.R := Real_Part;
        Obj.all.I := Imaginary_Part;
    end Create;

end Ptr_Complexe;

E3 Meta Data

    nblk1=2
    nid=0
    hdr6=4
        [0x00] rec0=21 rec1=00 rec2=01 rec3=018
        [0x01] rec0=1c rec1=00 rec2=02 rec3=001
    tail 0x2174ae65a8654487342ec 0x42a00088462060003