Data update
This commit is contained in:
parent
4d5544505c
commit
4924dd0264
3073 changed files with 55820 additions and 4408 deletions
10
Task/Twos-complement/Ada/twos-complement.ada
Normal file
10
Task/Twos-complement/Ada/twos-complement.ada
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
with Ada.Text_IO;
|
||||
|
||||
procedure Twos_Complement is
|
||||
type Number is mod 2 ** 32;
|
||||
A : constant Number := 42;
|
||||
B : constant Number := not A + 1;
|
||||
Is_Negative : constant Boolean := A + B = 0;
|
||||
begin
|
||||
Ada.Text_IO.Put_Line ("B = -A is " & Is_Negative'Image);
|
||||
end Twos_Complement;
|
||||
Loading…
Add table
Add a link
Reference in a new issue