Calculator that Evaluates an Expression
Return to list of examples
Help
You can enter an expression such as 3/2 + 4*(12+3).
You can also enter JavaScript's Math properties and Methods.
For example, to find the value of pi(p), type:
PI (Note: JavaScript is case sensitive. PI in all CAPS.
To find the log of 3, type (lower case):
log(3)
To find 2 raised to the 3rd power, type:
pow(2,3)
To find the area of a 9 inch pizza (in sq. inches), type:
PI*pow(9/2,2)
----------Math properties (Constants. Note, all caps).
E (Base of natural logs, about 2.718)
LN10 (Natural log of 10, about 2.302)
LN2 (Natural log of 2, about .693)
PI (pi = ratio of circumference of circle to diameter, about 3.142)
SQRT1_2 (square root of 1/2, about .707)
SQRT2 (square root of 2, about 1.414)
----------Methods (Functions. Note, no caps)-----
abs(x) (absolute value of x)
acos(x) (arc cosine of x, in radians)
asin(x) (arc sine of x, in radians)
atan(x) (arc tangent of x, in radians)
ceil(x) (next greater integer than x)
cos(x) (cosine of x, x in radians)
exp(x) (exponential function of x)
floor(x) (next smaller integer)
log(x) (natural logarithm of x)
max(x,y) (maximum of x, y)
min(x,y) (minimum of x, y)
pow(x,y) (x raised to the y power)
random() (pseudo-random number, uniform between 0 and 1)
round(x) (rounds x to the nearest integer)
sin(x) (sine of x, where x in radians)
sqrt(x) (square root of x)
tan(x) (tangent of x, where x is in radians)