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: F T

⟦33ec0ecbc⟧ TextFile

    Length: 14123 (0x372b)
    Types: TextFile
    Names: »FLOAT_MATH_LIB_SERVER_BODY«

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 Text_Io;
with Interchange;
with Transport_Interchange;
with Float_Math_Lib;

package body Float_Math_Lib_Server is

    procedure Process_Call (Stream : Transport_Stream.Stream_Id;
                            Id : Rpc.Transaction_Id;
                            Version : Rpc.Version_Number;
                            Proc : Rpc.Procedure_Number) is
    begin
        case Proc is
            when Float_Math_Lib_Defs.Proc_Number.Sqrt =>
                declare
                    Input : Float;
                    Answer : Float;
                begin
                    Transport_Interchange.Get (Stream,
                                               Interchange.Float (Input));
                    Answer := Float_Math_Lib.Sqrt (Input);
                    Rpc_Server.Begin_Response (Stream, Id);
                    Transport_Interchange.Put (Stream,
                                               Interchange.Float (Answer));
                end;
            when Float_Math_Lib_Defs.Proc_Number.Log =>
                declare
                    Input : Float;
                    Answer : Float;
                begin
                    Transport_Interchange.Get (Stream,
                                               Interchange.Float (Input));
                    Answer := Float_Math_Lib.Log (Input);
                    Rpc_Server.Begin_Response (Stream, Id);
                    Transport_Interchange.Put (Stream,
                                               Interchange.Float (Answer));
                end;
            when Float_Math_Lib_Defs.Proc_Number.Log10 =>
                declare
                    Input : Float;
                    Answer : Float;
                begin
                    Transport_Interchange.Get (Stream,
                                               Interchange.Float (Input));
                    Answer := Float_Math_Lib.Log10 (Input);
                    Rpc_Server.Begin_Response (Stream, Id);
                    Transport_Interchange.Put (Stream,
                                               Interchange.Float (Answer));
                end;
            when Float_Math_Lib_Defs.Proc_Number.Log2 =>
                declare
                    Input : Float;
                    Answer : Float;
                begin
                    Transport_Interchange.Get (Stream,
                                               Interchange.Float (Input));
                    Answer := Float_Math_Lib.Log2 (Input);
                    Rpc_Server.Begin_Response (Stream, Id);
                    Transport_Interchange.Put (Stream,
                                               Interchange.Float (Answer));
                end;
            when Float_Math_Lib_Defs.Proc_Number.Exp =>
                declare
                    Input : Float;
                    Answer : Float;
                begin
                    Transport_Interchange.Get (Stream,
                                               Interchange.Float (Input));
                    Answer := Float_Math_Lib.Exp (Input);
                    Rpc_Server.Begin_Response (Stream, Id);
                    Transport_Interchange.Put (Stream,
                                               Interchange.Float (Answer));
                end;
            when Float_Math_Lib_Defs.Proc_Number.Sin =>
                declare
                    Input : Float;
                    Answer : Float;
                begin
                    Transport_Interchange.Get (Stream,
                                               Interchange.Float (Input));
                    Answer := Float_Math_Lib.Sin (Input);
                    Rpc_Server.Begin_Response (Stream, Id);
                    Transport_Interchange.Put (Stream,
                                               Interchange.Float (Answer));
                end;
            when Float_Math_Lib_Defs.Proc_Number.Cos =>
                declare
                    Input : Float;
                    Answer : Float;
                begin
                    Transport_Interchange.Get (Stream,
                                               Interchange.Float (Input));
                    Answer := Float_Math_Lib.Cos (Input);
                    Rpc_Server.Begin_Response (Stream, Id);
                    Transport_Interchange.Put (Stream,
                                               Interchange.Float (Answer));
                end;
            when Float_Math_Lib_Defs.Proc_Number.Tan =>
                declare
                    Input : Float;
                    Answer : Float;
                begin
                    Transport_Interchange.Get (Stream,
                                               Interchange.Float (Input));
                    Answer := Float_Math_Lib.Tan (Input);
                    Rpc_Server.Begin_Response (Stream, Id);
                    Transport_Interchange.Put (Stream,
                                               Interchange.Float (Answer));
                end;
            when Float_Math_Lib_Defs.Proc_Number.Asin =>
                declare
                    Input : Float;
                    Answer : Float;
                begin
                    Transport_Interchange.Get (Stream,
                                               Interchange.Float (Input));
                    Answer := Float_Math_Lib.Asin (Input);
                    Rpc_Server.Begin_Response (Stream, Id);
                    Transport_Interchange.Put (Stream,
                                               Interchange.Float (Answer));
                end;
            when Float_Math_Lib_Defs.Proc_Number.Acos =>
                declare
                    Input : Float;
                    Answer : Float;
                begin
                    Transport_Interchange.Get (Stream,
                                               Interchange.Float (Input));
                    Answer := Float_Math_Lib.Acos (Input);
                    Rpc_Server.Begin_Response (Stream, Id);
                    Transport_Interchange.Put (Stream,
                                               Interchange.Float (Answer));
                end;
            when Float_Math_Lib_Defs.Proc_Number.Atan =>
                declare
                    Input_1, Input_2 : Float;
                    Answer : Float;
                begin
                    Transport_Interchange.Get (Stream,
                                               Interchange.Float (Input_1));
                    Transport_Interchange.Get (Stream,
                                               Interchange.Float (Input_2));
                    Answer := Float_Math_Lib.Atan2 (Input_1, Input_2);
                    Rpc_Server.Begin_Response (Stream, Id);
                    Transport_Interchange.Put (Stream,
                                               Interchange.Float (Answer));
                end;
            when Float_Math_Lib_Defs.Proc_Number.Sinh =>
                declare
                    Input : Float;
                    Answer : Float;
                begin
                    Transport_Interchange.Get (Stream,
                                               Interchange.Float (Input));
                    Answer := Float_Math_Lib.Sinh (Input);
                    Rpc_Server.Begin_Response (Stream, Id);
                    Transport_Interchange.Put (Stream,
                                               Interchange.Float (Answer));
                end;
            when Float_Math_Lib_Defs.Proc_Number.Cosh =>
                declare
                    Input : Float;
                    Answer : Float;
                begin
                    Transport_Interchange.Get (Stream,
                                               Interchange.Float (Input));
                    Answer := Float_Math_Lib.Cosh (Input);
                    Rpc_Server.Begin_Response (Stream, Id);
                    Transport_Interchange.Put (Stream,
                                               Interchange.Float (Answer));
                end;
            when Float_Math_Lib_Defs.Proc_Number.Tanh =>
                declare
                    Input : Float;
                    Answer : Float;
                begin
                    Transport_Interchange.Get (Stream,
                                               Interchange.Float (Input));
                    Answer := Float_Math_Lib.Tanh (Input);
                    Rpc_Server.Begin_Response (Stream, Id);
                    Transport_Interchange.Put (Stream,
                                               Interchange.Float (Answer));
                end;
            when Float_Math_Lib_Defs.Proc_Number.Sind =>
                declare
                    Input : Float;
                    Answer : Float;
                begin
                    Transport_Interchange.Get (Stream,
                                               Interchange.Float (Input));
                    Answer := Float_Math_Lib.Sind (Input);
                    Rpc_Server.Begin_Response (Stream, Id);
                    Transport_Interchange.Put (Stream,
                                               Interchange.Float (Answer));
                end;
            when Float_Math_Lib_Defs.Proc_Number.Cosd =>
                declare
                    Input : Float;
                    Answer : Float;
                begin
                    Transport_Interchange.Get (Stream,
                                               Interchange.Float (Input));
                    Answer := Float_Math_Lib.Cosd (Input);
                    Rpc_Server.Begin_Response (Stream, Id);
                    Transport_Interchange.Put (Stream,
                                               Interchange.Float (Answer));
                end;
            when Float_Math_Lib_Defs.Proc_Number.Tand =>
                declare
                    Input : Float;
                    Answer : Float;
                begin
                    Transport_Interchange.Get (Stream,
                                               Interchange.Float (Input));
                    Answer := Float_Math_Lib.Tand (Input);
                    Rpc_Server.Begin_Response (Stream, Id);
                    Transport_Interchange.Put (Stream,
                                               Interchange.Float (Answer));
                end;
            when Float_Math_Lib_Defs.Proc_Number.Asind =>
                declare
                    Input : Float;
                    Answer : Float;
                begin
                    Transport_Interchange.Get (Stream,
                                               Interchange.Float (Input));
                    Answer := Float_Math_Lib.Asind (Input);
                    Rpc_Server.Begin_Response (Stream, Id);
                    Transport_Interchange.Put (Stream,
                                               Interchange.Float (Answer));
                end;
            when Float_Math_Lib_Defs.Proc_Number.Acosd =>
                declare
                    Input : Float;
                    Answer : Float;
                begin
                    Transport_Interchange.Get (Stream,
                                               Interchange.Float (Input));
                    Answer := Float_Math_Lib.Acosd (Input);
                    Rpc_Server.Begin_Response (Stream, Id);
                    Transport_Interchange.Put (Stream,
                                               Interchange.Float (Answer));
                end;
            when Float_Math_Lib_Defs.Proc_Number.Atand =>
                declare
                    Input : Float;
                    Answer : Float;
                begin
                    Transport_Interchange.Get (Stream,
                                               Interchange.Float (Input));
                    Answer := Float_Math_Lib.Atand (Input);
                    Rpc_Server.Begin_Response (Stream, Id);
                    Transport_Interchange.Put (Stream,
                                               Interchange.Float (Answer));
                end;
            when Float_Math_Lib_Defs.Proc_Number.Atan2d =>
                declare
                    Input_1, Input_2 : Float;
                    Answer : Float;
                begin
                    Transport_Interchange.Get (Stream,
                                               Interchange.Float (Input_1));
                    Transport_Interchange.Get (Stream,
                                               Interchange.Float (Input_2));
                    Answer := Float_Math_Lib.Atan2d (Input_1, Input_2);
                    Rpc_Server.Begin_Response (Stream, Id);
                    Transport_Interchange.Put (Stream,
                                               Interchange.Float (Answer));
                end;
            when others =>
                raise Rpc.No_Such_Procedure;
        end case;
    exception
        when Float_Math_Lib.Roprand =>
            Rpc_Server.Return_Exception
               (Stream, Id, Float_Math_Lib_Defs.Exception_Number.Roprand);
        when Float_Math_Lib.Invargmat =>
            Rpc_Server.Return_Exception
               (Stream, Id, Float_Math_Lib_Defs.Exception_Number.Invargmat);
        when Float_Math_Lib.Floovemat =>
            Rpc_Server.Return_Exception
               (Stream, Id, Float_Math_Lib_Defs.Exception_Number.Floovemat);
        when Float_Math_Lib.Floundmat =>
            Rpc_Server.Return_Exception
               (Stream, Id, Float_Math_Lib_Defs.Exception_Number.Floundmat);
        when Float_Math_Lib.Logzerneg =>
            Rpc_Server.Return_Exception
               (Stream, Id, Float_Math_Lib_Defs.Exception_Number.Logzerneg);
        when Float_Math_Lib.Squrooneg =>
            Rpc_Server.Return_Exception
               (Stream, Id, Float_Math_Lib_Defs.Exception_Number.Squrooneg);
    end Process_Call;

    procedure Serve_Guts is new Rpc_Server.Serve
                                   (Program => Float_Math_Lib_Defs.Program);

    procedure Serve (Connection : Transport.Connection_Id) is
    begin
        Serve_Guts (Connection);
    end Serve;

end Float_Math_Lib_Server;