跳轉至內容

Ada 程式設計/分隔符/-

來自 Wikibooks,開放的書籍,開放的世界

Ada. Time-tested, safe and secure.
Ada。經久耐用、安全可靠。

運算子

[編輯 | 編輯原始碼]

標準運算

[編輯 | 編輯原始碼]

算術減法

[編輯 | 編輯原始碼]

"-" 運算子被定義為所有數字型別中的算術減法。

function "-" (Left, Right : T) return T;
A : constant Float   := 5.0 - 2.0;  -- A is now 3.0
B : constant Integer := 5 - 2;      -- B is also 3

"-" 一元運算子被定義為所有數字型別中的算術負號。

function "-" (Left : T) return T;
A : constant Float   := -5.0;
B : constant Integer := -5;
C : constant Integer := -B;  -- C is now 5

另請參閱

[編輯 | 編輯原始碼]

Ada 95 參考手冊

[編輯 | 編輯原始碼]

Ada 2005 參考手冊

[編輯 | 編輯原始碼]



Ada 運算子
and and then > + abs &
or or else >= - mod
xor = < * rem in
not /= <= ** / not in
華夏公益教科書