Las traducciones son generadas a través de traducción automática. En caso de conflicto entre la traducción y la version original de inglés, prevalecerá la version en inglés.
La siguiente tabla muestra las expresiones aritméticas que se pueden usar con el lenguaje de expresiones JSON.
Operación | Expression | Input | Output |
---|---|---|---|
Suma | ["+", operand1, operand2] |
{ sum: ["+", 2, 4] } |
{ sum: 6 } |
Resta | ["-", operand1, operand2] |
{ difference: ["-", 10, 3] } |
{ difference: 7 } |
Multiplicación | ["*", operand1, operand2] |
{ product: ["*", 5, 6] } |
{ product: 30 } |
División | ["/", operand1, operand2] |
{ quotient: ["/", 20, 4] } |
{ quotient: 5 } |
Módulo | ["%", operand1, operand2] |
{ remainder: ["%", 15, 4] } |
{ remainder: 3 } |
Exponenciación | ["**", base, exponent] |
{ power: ["**", 2, 3] } |
{ power: 8 } |
Valor absoluto | ["abs", operand] |
{ absolute: ["abs", -5] } |
{ absolute: 5 } |
Square Root (Raíz cuadrada) | ["sqrt", operand] |
{ sqroot: ["sqrt", 16] } |
{ sqroot: 4 } |
Logaritmo (base 10) | ["log10", operand] |
{ log: ["log10", 100] } |
{ log: 2 } |
Logaritmo natural | ["ln", operand] |
{ ln: ["ln", Math.E] } |
{ ln: 1 } |
Redondo | ["round", operand] |
{ rounded: ["round", 3.7] } |
{ rounded: 4 } |
Suelo | ["floor", operand] |
{ floor: ["floor", 3.7] } |
{ floor: 3 } |
Techo | ["ceil", operand] |
{ ceiling: ["ceil", 3.2] } |
{ ceiling: 4 } |
Seno | ["sin", operand] |
{ sine: ["sin", 0] } |
{ sine: 0 } |
Coseno | ["cos", operand] |
{ cosine: ["cos", 0] } |
{ cosine: 1 } |
Tangente | ["tan", operand] |
{ tangent: ["tan", Math.PI] } |
{ tangent: 0 } |