-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_func.adb
27 lines (25 loc) · 945 Bytes
/
test_func.adb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
with Ada.Numerics.Generic_Elementary_Functions;
with Ada.Text_IO;
with BBS.Numerical;
with BBS.Numerical.functions_real;
procedure test_func is
subtype real is Float;
package funct is new BBS.Numerical.functions_real(real);
package float_io is new Ada.Text_IO.Float_IO(real);
package elem is new Ada.Numerics.Generic_Elementary_Functions(real);
begin
Ada.Text_IO.Put_Line("Testing some of the numerical routines.");
Ada.Text_IO.Put_Line(" Gamma Function");
Ada.Text_IO.Put_Line(" N gamma2n lngamma2n exp(lngamma2n)");
for i in 1 .. 100 loop
Ada.Text_IO.Put(" ");
float_io.Put(Real(i), 3, 0, 0);
Ada.Text_IO.Put(" ");
float_io.Put(funct.gamma2n(i), 2, 6, 3);
Ada.Text_IO.Put(" ");
float_io.Put(funct.lngamma2n(i), 3, 2, 0);
Ada.Text_IO.Put(" ");
float_io.Put(elem.exp(funct.lngamma2n(i)), 2, 6, 3);
Ada.Text_IO.New_Line;
end loop;
end test_func;