Les traductions sont fournies par des outils de traduction automatique. En cas de conflit entre le contenu d'une traduction et celui de la version originale en anglais, la version anglaise prévaudra.
Le tableau suivant présente les expressions arithmétiques qui peuvent être utilisées avec le langage d'expression JSON.
Opération | Expression | Entrée | Sortie |
---|---|---|---|
Addition | ["+", operand1, operand2] |
{ sum: ["+", 2, 4] } |
{ sum: 6 } |
Soustraction | ["-", operand1, operand2] |
{ difference: ["-", 10, 3] } |
{ difference: 7 } |
Multiplication | ["*", operand1, operand2] |
{ product: ["*", 5, 6] } |
{ product: 30 } |
Division | ["/", operand1, operand2] |
{ quotient: ["/", 20, 4] } |
{ quotient: 5 } |
Module | ["%", operand1, operand2] |
{ remainder: ["%", 15, 4] } |
{ remainder: 3 } |
Exponentiation | ["**", base, exponent] |
{ power: ["**", 2, 3] } |
{ power: 8 } |
Valeur absolue | ["abs", operand] |
{ absolute: ["abs", -5] } |
{ absolute: 5 } |
Square Root (Racine carrée) | ["sqrt", operand] |
{ sqroot: ["sqrt", 16] } |
{ sqroot: 4 } |
Logarithme (base 10) | ["log10", operand] |
{ log: ["log10", 100] } |
{ log: 2 } |
Logarithme naturel | ["ln", operand] |
{ ln: ["ln", Math.E] } |
{ ln: 1 } |
Ronde | ["round", operand] |
{ rounded: ["round", 3.7] } |
{ rounded: 4 } |
Étage | ["floor", operand] |
{ floor: ["floor", 3.7] } |
{ floor: 3 } |
Plafond | ["ceil", operand] |
{ ceiling: ["ceil", 3.2] } |
{ ceiling: 4 } |
Sinusoïdal | ["sin", operand] |
{ sine: ["sin", 0] } |
{ sine: 0 } |
Cosinus | ["cos", operand] |
{ cosine: ["cos", 0] } |
{ cosine: 1 } |
Tangente | ["tan", operand] |
{ tangent: ["tan", Math.PI] } |
{ tangent: 0 } |