attributes_main.adb.npp

来自「This contains the following topics and m」· NPP 代码 · 共 53 行

NPP
53
字号
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 + -
显示快捷键?