new files
This commit is contained in:
parent
3af7344581
commit
86c034bb8b
1364 changed files with 21352 additions and 0 deletions
24
Task/Infinity/Ada/infinity-1.ada
Normal file
24
Task/Infinity/Ada/infinity-1.ada
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
|
||||
procedure Infinities is
|
||||
function Sup return Float is -- Only for predefined types
|
||||
Result : Float := Float'Last;
|
||||
begin
|
||||
if not Float'Machine_Overflows then
|
||||
Result := Float'Succ (Result);
|
||||
end if;
|
||||
return Result;
|
||||
end Sup;
|
||||
|
||||
function Inf return Float is -- Only for predefined types
|
||||
Result : Float := Float'First;
|
||||
begin
|
||||
if not Float'Machine_Overflows then
|
||||
Result := Float'Pred (Result);
|
||||
end if;
|
||||
return Result;
|
||||
end Inf;
|
||||
begin
|
||||
Put_Line ("Supremum" & Float'Image (Sup));
|
||||
Put_Line ("Infimum " & Float'Image (Inf));
|
||||
end Infinities;
|
||||
Loading…
Add table
Add a link
Reference in a new issue