โŒ About FreshRSS

Normal view

There are new articles available, click to refresh the page.
Before yesterdayNewest questions tagged ada - Stack Overflow

What is the difference between `long_integer` and `integer` in ada language?

with ada.text_io;

procedure numbers is 

   int1 : integer := 2147483647; --almost 4 bytes
   int2 : integer := -2147483647;

   lng1 : long_integer := 2147483647;
   lng2 : long_integer := -2147483647;

begin 

   ada.text_io.put_line(int1'image);
   ada.text_io.put_line(int2'image);

   ada.text_io.put_line(lng1'image);
   ada.text_io.put_line(lng2'image);

end numbers;

result :

 2147483647
-2147483647
 2147483647
-2147483647

I am new to this programming language and suddenly found this long_integer and integer datatypes in the ada language are the same in size and the type of data they can represent is there any key difference between these two datatypes ?

โŒ
โŒ