
Welcome to JavaCalc
|About|Sample|Properties|Methods|JavaCalc|
About JavaCalc
JavaCalc is a simple demonstration of JavaScript (AKA LiveScript) of
Netscape Navigator. You can evaluate your expressions through the above
INPUT box. Unfortunately, this JavaCalc does not support function, loop
and multiple output (yet?). However, you can enjoy powerful variables and
multi-expression capabilities. Note, names are caps sensitive.
|About|Sample|Properties|Methods|JavaCalc|
Sample Expressions
1+5
PI*sin(0.5)
Example of multi-expressions
m=0.4;
p=1/PI;
z=m*pow(sin(p),2);
du=sqrt(1-z)
Date()
"hello, world!".toUpperCase() --- Yes, its object oriented
calculator. Surprised?
|About|Sample|Properties|Methods|JavaCalc|
Math Properties
- E : Euler's constant and the base of natural logarithms, approximately
2.718.
- LN10 : The natural logarithm of ten, approximately 2.302.
- LN2 : The natural logarithm of two, approximately 0.693.
- PI : The ratio of the circumference of a circle to its diameter, approximately
3.1415.
- SQRT1_2 : The square root of one-half; equivalently, one over the square
root of two, approximately 0.707.
- SQRT2: The square root of two, approximately 1.414.
|About|Sample|Properties|Methods|JavaCalc|
Math Methods
- abs : Returns the absolute value of a number.
- acos : Returns the arc cosine (in radians) of a number.
- asin : Returns the arc sine (in radians) of a number.
- atan : Returns the arc tangent (in radians) of a number.
- ceil : Returns the least integer greater than or equal to a number.
- cos : Returns the cosine of a number.
- exp : Returns e to the power of its argument (ex), where x is the argument,
and e is Euler's constant, the base of the natural logarithms.
- floor : Returns the greatest integer less than or equal to a number.
- log : Returns the natural logarithm (base e) of a number.
- max : Returns the greater of two numbers.
- min : Returns the lesser of two numbers.
- pow : Returns base to the exponent power. Apply pow(x,y) instead of
x^y.
- random : Returns a pseudo-random number between zero and one. This
method is available on X-platforms only
- round : Returns the value of a number rounded to the nearest integer.
If the decimal portion of the argument is .5 or greater, the argument is
rounded to the next highest integer. If the decimal portion of the argument
is less than .5, the argument is rounded to the next lowest integer.
- sin : Returns the sine of a number.
- sqrt : Returns the square root of a number.
- tan : Returns the tangent of a number.
Bonus. The following is not available on the JavaScript. But, I added it
in JavaCalc for your convenience.
- factorial : Returns the factorial of a number. For example, factorial(3)
returns 6.
- round2 : Returns the number rounded to a specified number of digits.
For example, round2(PI,-4) returns 3.1416. Tested on Navigator 3.
|About|Sample|Properties|Methods|JavaCalc|
