par_tocontrol_float_values.adb.npp

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

NPP
28
字号
-- 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 Getwith 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;

⌨️ 快捷键说明

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