Calculates the value of a math expression or formula.
Expression
— A math expression or formula, for example:
distance / time
avg(a, b, c)
PI * r^2
area = width * height
Values
— The numbers to substitute in place of the variables in Expression
.Result
— The number calculated from Expression
.The math expression may contain one or more input variables — names like Distance
, Time
, or A
that are replaced with the numbers in Values
.
Optionally, the math expression may contain an output variable — a name for the calculated result, to help you remember what it represents. If there’s an output variable, the math expression should have a =
sign (assignment operator) with the output variable on the left and the input variables on the right. For example, in the expression area = width * height
, the output variable is Area
and the input variables are Width
and Height
.
The math expressions may contain:
(
and )
P I
— π, approximately 3.14+
— addition-
— subtraction*
— multiplication/
— division^
— power/exponent%
— modulus<
— less than>
— greater than<=
— less than or equal>=
- greater than or equal==
— equal!=
— not equal&&
— logical and||
— logical or?:
— if-then-else, for example: score > 100 ? bonus : 0
Avg
— average of a list of numbersSum
— sum of a list of numbersMin
— minimum of a list of numbersMax
— maximum of a list of numbersAbs
— absolute valueRint
— round to the nearest integerSign
— -1 if negative, 1 if positiveSqrt
— square rootExp
— the mathematical constant e raised to a powerLn
— logarithm to base eLog
or Log 10
— logarithm to base 10Log 2
— logarithm to base 2Deg 2rad
— convert degrees to radiansRad 2deg
— convert radians to degreesSin
, Cos
, Tan
Asin
, Acos
, Atan
Sinh
, Cosh
, Tanh
Asinh
, Acosh
, Atanh
Keywords: %, &&, *, +, -, /, <, <=, ==, >, >=, ^, abs, acos, acosh, add, and, asin, asinh, atan, atanh, avg, compare, condition, cos, cosh, difference, divide, equal, equation, exp, expression, formula, greater, if, less, ln, log, log10, log2, logic, mathematics, maths, max, min, minus, modulus, multiply, or, pi, power, product, quotient, rint, sign, sin, sinh, sqrt, subtract, sum, tan, tanh, trigonometry