Fsharp-arithmetic-operators
提供:Dev Guides
F#-算術演算子
次の表は、F#言語でサポートされているすべての算術演算子を示しています。 変数Aが10を保持し、変数Bが20を保持すると仮定します-
Operator | Description | Example |
---|---|---|
+ | Adds two operands | A + B will give 30 |
- | Subtracts second operand from the first | A - B will give -10 |
* | Multiplies both operands | A* B will give 200 |
/ | Divides numerator by de-numerator | B/A will give 2 |
% | Modulus Operator and remainder of after an integer division | B % A will give 0 |
** | Exponentiation Operator, raises an operand to the power of another | B**A will give 2010 |
例
あなたがプログラムをコンパイルして実行すると、次の出力が得られます-