使用 Image 屬性列印出 float
Version = 有 2012 年(TC-1)
with Ada.Text_IO;
procedure Main is
type Some_Float digits 8 range 0.0 .. 10.0;
X : Some_Float := 2.71;
begin
Ada.Text_IO.Put_Line (X'Image);
end Main;
結果
2.71000E+00
with Ada.Text_IO;
procedure Main is
type Some_Float digits 8 range 0.0 .. 10.0;
X : Some_Float := 2.71;
begin
Ada.Text_IO.Put_Line (X'Image);
end Main;
2.71000E+00