⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 par_tocontrol_float_values.adb

📁 This contains the following topics and more ADA versus C and Cplus plus Ada_training ADA 2005 for
💻 ADB
字号:
-- A floating point number is output using the overloaded procedure Put, though
-- by default this displays the number in scientific notation. Extra parameters
-- to Put are used to control the output form of the floating point number.
-- These parameters are used together or individually. The main parameters to
-- control the format are named Fore,Aft and Exp. For example, to output the
-- contents of the Float object Num that contains 123.456 the following
--versions of Put may be used:

-- A floating point number is output using the overloaded procedure Get
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 par_tocontrol_float_values is
   number : Float := 23.45E+02;
   value  : Float;
begin
   Get (value, Width => 4);
   Put (value);
   New_Line;
   Put (number);
   New_Line;
   Put (number, Fore => 3, Aft => 1, Exp => 0);

   New_Line;
   Put (number, Fore => 2, Aft => 2, Exp => 1);
   New_Line;
end par_tocontrol_float_values;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -