

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# 算術演算
<a name="jle-arithmetics"></a>

以下の表は、JSON 式言語で使用できる算術式を示しています。


| 運用 | 式 | Input | Output | 
| --- | --- | --- | --- | 
| 加算 | ["\+", operand1, operand2] | { sum: ["\+", 2, 4] } | { sum: 6 } | 
| 減算 | ["-", operand1, operand2] | { difference: ["-", 10, 3] } | { difference: 7 } | 
| 乗算 | ["\*", operand1, operand2] | { product: ["\*", 5, 6] } | { product: 30 } | 
| 除算 | ["/", operand1, operand2] | { quotient: ["/", 20, 4] } | { quotient: 5 } | 
| モジュロ | ["%", operand1, operand2] | { remainder: ["%", 15, 4] } | { remainder: 3 } | 
| べき算 | ["\*\*", base, exponent] | { power: ["\*\*", 2, 3] } | { power: 8 } | 
| 絶対値 | ["abs", operand] | { absolute: ["abs", -5] } | { absolute: 5 } | 
| [Square Root] (平方根) | ["sqrt", operand] | { sqroot: ["sqrt", 16] } | { sqroot: 4 } | 
| 対数 (底 10) | ["log10", operand] | { log: ["log10", 100] } | { log: 2 } | 
| 自然対数 | ["ln", operand] | { ln: ["ln", Math.E] } | { ln: 1 } | 
| 丸め | ["round", operand] | { rounded: ["round", 3.7] } | { rounded: 4 } | 
| 切り捨て | ["floor", operand] | { floor: ["floor", 3.7] } | { floor: 3 } | 
| 切り上げ | ["ceil", operand] | { ceiling: ["ceil", 3.2] } | { ceiling: 4 } | 
| サイン (正弦) | ["sin", operand] | { sine: ["sin", 0] } | { sine: 0 } | 
| コサイン | ["cos", operand] | { cosine: ["cos", 0] } | { cosine: 1 } | 
| タンジェント | ["tan", operand] | { tangent: ["tan", Math.PI] } | { tangent: 0 } | 