**Version 1.11**: This web tool evaluates any real and complex expression. It supports the usual arithmetic operators, build in constants and build in functions.
__Arithmetic Operators:__
+,-,*,/ ,% and ^
Example:
2+3*5-1 which evaluate to 16. Or with complex numbers (2-i)*(5+i3) which evaluates to (13+i1) you can also do the power operator ^ with complex number. E.g. (2-i1)^(5+i3) which evaluates to approx. 223.6+i21.5
__Build in constants:__
Constants |
Math Symbol |
Value |
PI |
π |
3.141592653589793 |
E |
E |
2.718281828459045 |
LN10 |
Log_{e}10 |
2.302585092994046 |
LN2 |
Log_{e}2 |
0.6931471805599453 |
LOG10E |
Log_{10}e |
0.4342944819032518 |
LOG2E |
Log_{10}2 |
1.4426950408889633 |
SQRT2 |
sqrt(2) |
1.4142135623730951 |
SQRT1_2 |
1/sqrt(2) |
0.7071067811865476 |
Build-in constant can’t be overwritten by the assignment statement. E.g. LN2=10 will return with a syntax error message.
Implicit multiplication is also supported e.g. 2PI evaluates to approx. 6.28 and 5(sqrt(2)+2) evaluates to approx.. 17.07
__Assignment Statement:__ You can use assignment statement (= assignment operator) as save the result in a variable. E.g. x=2 and then later use the variable x in a later statement or expression e.g. sqrt(x). You can change the contents of the variable with a new assignment statement.
__Build-in functions:__
abs, acos, asin, atan, atan2*, asinh, acosh, atanh, ceil*, cosh, cos, exp, floor*, log, max*, min*, pow, random**, round*, sinh, sin, sqrt, tanh, tan.
**) marked are functions that takes zero argument. *) marked are functions that only takes real arguments, all other takes real or complex arguments. e.g. sqrt(2-i2) evaluates to approx. (1.55+i0.64).
Build-in functions can’t be overwritten by the assignment statement. E.g. sin=3 will give a syntax error message.
__Variables:__ You can also assign expression to a variable for later use: e.g. x=sqrt(2-i2)*3/4 and then used them later. E.g. y=log(123.5)/x etc.
__Functions: __In version 1.2 we have added functions. First you would need to define a function as in the following:
f(x)=2*sqrt(x)
and then just call the function with a parameter e.g.:
3*log(f(4))
__Compound Statements____:__ You can use compound statements in functions or just in general to create a block of statements. e.g.
f(x)={ y=x; y=3+y; z=5; }
__Comma Expressions__: Can also be useful when you want to evaluate several expressions in a function but only return the last expression as the result of the functions call. E.g.
f(x)={ y=2, x=sqrt(x)/y, log(x+2) }
here log(x+2) is returned as the value of the function to be use in another statement.
In a function call you can have as many parameters as you like however the number of parameter passed to a function must match the definition of the functions.
Example: Durand-Kerner method on a polynomial f(x)=x^3-3*x^2+3*x-5
Add each line below to the input field and hit the evaluate button after each line. Then type in next() and see the value of the roots for each iteration.
p=(0.4 + 0.9 i)^0, q=(0.4 + 0.9 i)^1, r=(0.4 + 0.9 i)^2
f(x)=x^3-3*x^2+3*x-5
next()={dp=f(p)/((p-q)*(p-r)); p=p-dp; dq=f(q)/((q-p)*(q-r));q=q-dq;dr=f(r)/((r-p)*(r-q));r=r-dr;}
**Final Note:** If you refresh your browser or exit you lose all variables.
The History section keeps track on your previous expression evaluations. Email me if you encounter any problems at hve@hvks.com |