Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,46 +0,0 @@
|
|||
with Ada.Text_IO;
|
||||
|
||||
procedure Converging_Sequence is
|
||||
|
||||
generic
|
||||
type Num is digits <>;
|
||||
After: Positive;
|
||||
procedure Task_1;
|
||||
|
||||
procedure Task_1 is
|
||||
package FIO is new Ada.Text_IO.Float_IO(Num);
|
||||
package IIO is new Ada.Text_IO.Integer_IO(Integer);
|
||||
|
||||
procedure Output (I: Integer; N: Num) is
|
||||
begin
|
||||
IIO.Put(Item => I, Width => 4);
|
||||
FIO.Put(Item => N, Fore => 4, Aft => After, Exp => 0);
|
||||
Ada.Text_IO.New_Line;
|
||||
end Output;
|
||||
|
||||
Very_Old: Num := 2.0;
|
||||
Old: Num := -4.0;
|
||||
Now: Num;
|
||||
begin
|
||||
Ada.Text_IO.Put_Line("Converging Sequence with" & Integer'Image(After) &
|
||||
" digits");
|
||||
for I in 3 .. 100 loop
|
||||
Now := 111.0 - 1130.0 / Old + 3000.0 / (Old * Very_Old);
|
||||
Very_Old := Old;
|
||||
Old := Now;
|
||||
if (I < 9) or else (I=20 or I=30 or I=50 or I=100) then
|
||||
Output(I, Now);
|
||||
end if;
|
||||
end loop;
|
||||
Ada.Text_IO.New_Line;
|
||||
end Task_1;
|
||||
|
||||
type Short is digits(8);
|
||||
type Long is digits(16);
|
||||
|
||||
procedure Task_With_Short is new Task_1(Short, 8);
|
||||
procedure Task_With_Long is new Task_1(Long, 16);
|
||||
begin
|
||||
Task_With_Short;
|
||||
Task_With_Long;
|
||||
end Converging_Sequence;
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
with Ada.Text_IO, Ada.Numerics;
|
||||
|
||||
procedure Chaotic_Bank is
|
||||
|
||||
generic
|
||||
type Num is digits <>;
|
||||
After: Positive;
|
||||
procedure Task_2;
|
||||
|
||||
procedure Task_2 is
|
||||
package IIO is new Ada.Text_IO.Integer_IO(Integer);
|
||||
package FIO is new Ada.Text_IO.Float_IO(Num);
|
||||
Balance: Num := Ada.Numerics.E - 1.0;
|
||||
begin
|
||||
Ada.Text_IO.Put_Line("Chaotic Bank Society with" &
|
||||
Integer'Image(After) & " digits");
|
||||
Ada.Text_IO.Put_Line("year balance");
|
||||
for year in 1 .. 25 loop
|
||||
Balance := (Balance * Num(year))- 1.0;
|
||||
IIO.Put(Item => Year, Width => 2);
|
||||
FIO.Put(Balance, Fore => 11, Aft => After, Exp => 0);
|
||||
Ada.Text_IO.New_Line;
|
||||
end loop;
|
||||
Ada.Text_IO.New_Line;
|
||||
end Task_2;
|
||||
|
||||
type Short is digits(8);
|
||||
type Long is digits(16);
|
||||
|
||||
procedure Task_With_Short is new Task_2(Short, 8);
|
||||
procedure Task_With_Long is new Task_2(Long, 16);
|
||||
|
||||
begin
|
||||
Task_With_Short;
|
||||
Task_With_Long;
|
||||
end Chaotic_Bank;
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
|
||||
procedure Rumps_example is
|
||||
|
||||
type Short is digits(8);
|
||||
type Long is digits(16);
|
||||
|
||||
A: constant := 77617.0;
|
||||
B: constant := 33096.0;
|
||||
C: constant := 333.75*B**6 + A**2*(11.0*A**2*B**2 - B**6 - 121.0*B**4 - 2.0) + 5.5*B**8 + A/(2.0*B);
|
||||
|
||||
package LIO is new Float_IO(Long);
|
||||
package SIO is new Float_IO(Short);
|
||||
begin
|
||||
Put("Rump's Example, Short: ");
|
||||
SIO.Put(C, Fore => 1, Aft => 8, Exp => 0); New_Line;
|
||||
Put("Rump's Example, Long: ");
|
||||
LIO.Put(C, Fore => 1, Aft => 16, Exp => 0); New_Line;
|
||||
end Rumps_example;
|
||||
Loading…
Add table
Add a link
Reference in a new issue