attributes_main.adb
来自「This contains the following topics and m」· ADB 代码 · 共 71 行
ADB
71 行
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
with Ada.Float_Text_IO; use Ada.Float_Text_IO;
procedure attributes_Main is
begin
--range of integer along with the bit length
Put ("Smallest Integer ");
Put (Integer'Image (Integer'First));
New_Line;
Put ("Largest Integer ");
Put (Integer'Image (Integer'Last));
New_Line;
Put ("Largest long Integer ");
Put (Long_Integer'Image (Long_Integer'Last));
New_Line;
Put ("Largest long long Integer ");
Put (Long_Long_Integer'Image (Long_Long_Integer'Last));
New_Line;
Put ("Integer(bits) ");
Put (Integer'Image (Integer'Size));
New_Line;
-- bits returns the size in bits of an integer object
Put ("Integer(digits) ");
Put (Integer'Image (Float'Digits));
-- digits returns the precision in decimal digits of a number stored in a
--integer object
New_Line;
Put ("long_Integer(digits) ");
Put (Long_Integer'Image (Long_Float'Digits));
New_Line;
New_Line;
New_Line;
New_Line;
New_Line;
--range of Float along with the bit length
Put ("smallest Float ");
Put (Float'Image (Float'First));
New_Line;
Put ("Largest Float ");
Put (Float'Image (Float'Last));
New_Line;
Put ("Largest long float ");
Put (Long_Float'Image (Long_Float'Last));
New_Line;
Put ("Largest long long Integer ");
Put (Long_Long_Float'Image (Long_Long_Float'Last));
New_Line;
Put ("Float(bits)");
Put (Integer'Image (Float'Size));
New_Line;
-- bits returns the size in bits of an float object
Put ("Float (digits)");
Put (Integer'Image (Float'Digits));
New_Line;
-- digits returns the precision in decimal digits of a number stored in a
--float object
Put ("long_float(digits) ");
Put (Long_Integer'Image (Long_Float'Digits));
New_Line;
end attributes_Main;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?