Как в Аде правильно вывести переменную с лавающей точкой на экран?
with Ada.Text_IO;
-- Ada.Float_Text_IO;
use Ada.Text_IO;
procedure Samp2 is
type MyString is new String;
S1 : MyString;
Pi : constant Float := 3.14_2;
subtype MyRange is Float range 0.00..100.00;
R : MyRange := 10.00;
S : Float; -- S1 : MyString;
begin
S := Pi * R ** 2;
S1 := String(S);
Put_Line(S1);
end Samp2;
Error:
samp2.adb:7:08: unconstrained subtype not allowed (need initialization)
samp2.adb:7:08: provide initial value or explicit array bounds
samp2.adb:19:15: expected type "MyString" defined at line 6
samp2.adb:19:15: found type "Standard.String"
samp2.adb:20:09: no candidate interpretations match the actuals:
samp2.adb:20:09: missing argument for parameter "Item" in call to "Put_Line" declared at a-textio.ads:259
samp2.adb:20:18: expected type "Standard.String"
samp2.adb:20:18: found type "MyString" defined at line 6
samp2.adb:20:18: ==> in call to "Put_Line" at a-textio.ads:263
End of compilation