Expression Evaluation Calculator
|
|
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 (Important: JavaScript is case sensitive! PI is in Upper Case ONLY!.
To find the log of 3, type (Lower Case ONLY):
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)
Parentheses () can change the order of operations
----------Legitimate Math Operators (Order and hierarchy is IMPORTANT!)
+ add
- subtract
/ divide
* multiply
() hierarchy - Example (4 + 1) / 2 or 4 + 1 / 2
% modulus - Example (8 + 7) % 13 returns 2
----------Legitimate Comparison Operators -------------
== equality - EXAMPLE 5 == 4 returns false
!= inequality - EXAMPLE 5 != 4 returns true
< less than - EXAMPLE 5 < 4 returns false
> greater than - EXAMPLE 5 > 4 returns true
<= less than or equal to - EXAMPLE 5 <= 4 returns false
>= greater than or equal to - EXAMPLE 5 >= 4 returns true
&& logical AND - EXAMPLE 5 > 4 && 3>4 returns false
|| logical OR - EXAMPLE 5 > 4 || 3>4 returns true
! logical NOT - EXAMPLE !(5==5) returns false
----------Math properties (Constants. Important: Upper Case ONLY!).
E (Base of natural logs, about 2.718)
LN10 (Natural log of 10, about 2.302)
LN2 (Natural log of 2, about .693)
LOG2E (Logarithm of E to base 2, about 1.442)
LOG10E (Logarithm of E to base 10, about .434)
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. Important: Lower Case ONLY!)-----
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)
|