1--
2-- Copyright(C) 1998
3-- All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
4--
5-- Permission to use, copy, modify, and distribute this
6-- software and its documentation for EDUCATIONAL purposes
7-- and without fee is hereby granted provided that this
8-- copyright notice appears in all copies.
9--
10
11-- date : January 1, 1998.
12-- author : Salih Yurttas.
13
14-- complex_00_p.adb
15
16
17with Ada.Text_IO;
18use Ada.Text_IO;
19
20package body Complex_00_P is
21
22 package Flo_IO is new Float_IO(Float);
23 use Flo_IO;
24
25 function Assemble(A,
26 B : in Float) return Complex is
27 begin
28 return (A, B);
29 end Assemble;
30
31 function Real_Part(C : in Complex) return Float is
32 begin
33 return (C.R_Part);
34 end Real_Part;
35
36 function Imaginary_Part(C : in Complex) return Float is
37 begin
38 return (C.I_Part);
39 end Imaginary_Part;
40
41 function "+"(C,
42 D : in Complex) return Complex is
43 begin
44 return (C.R_Part+D.R_Part, C.I_Part+D.I_Part);
45 end "+";
46
47end Complex_00_P;