Ada 程式設計/分隔符/**
外觀
“**”運算子定義為所有數字型別算術冪。
function"**" (Left : T; Right : Integer)returnT;
A :constantFloat := 5.0 ** 2; -- A is now 25.0 B :constantInteger := 5 ** 2; -- B is also 25
withAda.Text_IO;procedureOperator_PowerisA :constantFloat := 5.0 ** 2; -- A is now 25.0 B :constantInteger := 5 ** 2; -- B is also 25packageT_IOrenamesAda.Text_IO;packageF_IOisnewAda.Text_IO.Float_IO (Float);packageI_IOisnewAda.Text_IO.Integer_IO (Integer);beginT_IO.Put ("A = "); F_IO.Put ( Item => A, Fore => 3, Aft => 1, Exp => 0); T_IO.New_Line; T_IO.Put ("B = "); I_IO.Put ( Item => B, Width => 3, Base => 10); T_IO.New_Line;endOperator_Power;
- 4.4 表示式 (帶註釋)
- 4.5.6 最高階運算子 (帶註釋)
- 4.4 表示式 (帶註釋)
- 4.5.6 最高階運算子 (帶註釋)
| Ada 運算子 | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
