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

⟦f1958cb17⟧ Ada Source

    Length: 4096 (0x1000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Nombres, seg_00e3b7

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 body Nombres is

    package Behavior is new Classbehavior (Object, "NUMBERS   ");


    procedure Mult (R : Reference) is
        Unnombre : Object;
    begin
        -- effet de bord : resInter augmente
        Unnombre := Behavior.Get (R);
        Resinter := Resinter * Unnombre.Courant;
        Unnombre.Resultat := Resinter;
        Behavior.Set (R, Unnombre);
    end Mult;



    function Dernier (Lameilleure, Uneautre : Reference) return Boolean is
    begin
        return (Behavior.Get (Lameilleure).Resultat >
                Behavior.Get (Uneautre).Resultat);
    end Dernier;

    function Leresultat000 is new Collection.Themost (Dernier);

    function Leresultat (C : Collection.Object) return Reference is
    begin
        return (Leresultat000 (C));
    end Leresultat;

    -- partage de unNombre entre butAtteint et continuer
    function Butatteint return Boolean is
    begin
        Unnombre := Behavior.Get (Refnombrecourant);
        return (Unnombre.Courant = Unnombre.But);
    end Butatteint;

    procedure Continuer is
    begin
        Unnombre.Courant := Unnombre.Courant + 1;
        Refnombrecourant := Behavior.Allocate (Unnombre);
    end Continuer;


    procedure Calculfact is new Collection.Forall (Mult);

    procedure Calculerfact is
    begin
        Calculfact (Behavior.Instances);
    end Calculerfact;

    procedure Afficherfact is
    begin
        Put_Line (" ");
        Put ("Resultat factoriel: ");

        Refnombrecourant := Leresultat (Behavior.Instances);

        Put (Behavior.Get (Refnombrecourant).Resultat);
        Put_Line (" ");

    end Afficherfact;

    procedure Enroute is
    begin

        Unnombre.But := 7;
        Resinter := 1;

        Refnombrecourant := Behavior.Allocate (Unnombre);
        Put_Line (" ");
        Put (" Calcul de factorielle de : ");
        Put (Unnombre.But);
        Put_Line (" ... ");

    end Enroute;

end Nombres;





E3 Meta Data

    nblk1=3
    nid=0
    hdr6=6
        [0x00] rec0=23 rec1=00 rec2=01 rec3=04e
        [0x01] rec0=28 rec1=00 rec2=02 rec3=016
        [0x02] rec0=09 rec1=00 rec2=03 rec3=001
    tail 0x2170b0dd0821e3fbfc095 0x42a00088462060003