It is ideal for simple calculations that would be too tedious with a
hand calculator or
The source code is only a few lines.
numerics are not perfect, and neither am I.
(summarized below), the following features are supported:
- Prior assignment statements, function definitions, or other
As a result, you may write programs for numerical integration
and other special purposes. Terminate all statements
with a semicolon (;). The last expression will be evaluated and
the result displayed.
- Refer to the value displayed in the Result box:
- parsed as a decimal floating point number, R
- parsed as a decimal integer, L
- hyperbolic functions: sinh(), cosh(), tanh()
- inverse hyperbolic functions: asinh(), acosh(), atanh().
Note that acosh() returns positive numbers, but the sign is arbitrary.
- chbase(x,b) - round x to nearest integer and change base to
b, which may range from 2 to 16 (Communicator will take bases up to 36).
The result is a string. Includes correction
for a little-known bug in Navigator 3 which substitutes ':' for 'a' in bases 11
Math object. Expressions may include the following functions,
operator does not perform exponentiation - use pow() instead.
- Trigonometry (angles measured in radians):
- sin(x) - sine of x
- cos(x) - cosine of x
- tan(x) - tangent of x
- asin(x) - arc sine of x
- acos(x) - inverse cosine of x
- atan(x) - inverse tangent of x
- log(x) - natural logarithm of x
- exp(x) - Euler's constant to the x power
- pow(x,y) - x to the y power
- sqrt(x) - the square root of x
- abs(x,y) - absolute value of x
- max(x,y) - larger of two numbers
- min(x,y) - smaller of two numbers
- ceil(x) - the smallest integer greater than or equal to x
- floor(x) - the greatest integer less than or equal to x
- round(x) - x rounded to the nearest integer
- random() - a random number between zero and one
In addition, the following constants are defined (as properties of
the Math object):
- E - Euler's constant
- PI - pi
- LN10 - the natural logarithm of 10
- LN2 - the natural logarithm of 2
- SQRT1_2 - the square root of 1/2
- SQRT2 - the square root of 2
Drop me a line if you have comments or questions:
This page was last revised 2010 June 2.