allows you to evaluate mathematical expressions and convert numbers
to various numerical bases. Note that all numbers are treated as floating
points numbers (doubles). The syntax and operators are very similar
to C and Java - some small derivations exist, but they are explicitly
mentioned in this manual.
2.1 Addition & Subtraction
is respresented by the plus operator + and subtraction
is represented by the minus operator -.
Example: 3.2 + 10
- 0.9 results in 12.3.
Multiplication & Division
is respresented by the * operator and division is represented
by the / operator.
Example: 2 * 2*3
/ 5 results in 2.4.
modulo operation is respresented by the % operator.
It calculates the remainder of division of one number by another.
Example: 23 % 5
results in 3.
exponentiation (or power) operation is respresented by the ^
Example: (30/3) ^
(2+1) results in 1000.
Binary Left/Right Shift
binary left shift operation is respresented by the <<
operator and the binary right shift operation is represented by the
>> operator. The bit pattern is given by the
left-hand operand, and the number of positions to shift by the right-hand
operand. In fact 'x << y' is the same as x * (2^y) and 'x >>
y' is the same as x / (2^y). Note that the operands are converted to
Example: 1 <<
4 results in 16.
Example: 34.2 >>
2 results in 8.0.
AND, OR, XOR & NOT Operators
bitwise AND operation is represented by the & operator.
The bitwise Inclusive OR operation is represented by the |
operator. The bitwise Exclusive OR (XOR) operation is represented by
the # operator. The bitwise COMPLEMENT operation is
represented by the ! operator.
Note that the operands are converted to integers except the !
operator - that's a difference to C or Java. The !
operator converts bit by bit, also floating-point numbers without converting
them to integers.
Another difference to C/Java is the XOR operator which is represented
by the # operator and not by the ^
operator which is here used for exponentiation.
Example: 29 &
23 results in 21.0.
| 8 results in 12.0.
4.33 # 5.1 results in 1.0.
results in 17.25.
available operaters, shown in order of presedence - from highest to
3.1 Square Root (sqrt)
the correctly rounded positive square root of the given value.
results in 6.081118318204308.
the trigonometric sine of an angle in radians.
results in 0.9320390859672263.
the trigonometric cosine of an angle in radians.
results in 1.0.
the trigonometric tangent of an angle in radians.
results in 0.0.
Natural Logarithm (log)
Returns the natural logarithm (base e) of the given value.
results in 1.3132616875182228.
Base 10 Logarithm (log10)
the base 10 logarithm of the given value.
results in 2.0.
Arcus Sinus (asin)
the arc sine of an angle, in the range of -pi/2 through pi/2.
results in 1.5707963267948966.
Arcus Cosinus (acos)
the arc cosine of an angle, in the range of 0.0 through pi.
results in 3.141592653589793.
Arcus Tangent (atan)
the arc tangent of an angle, in the range of -pi/2 through pi/2.
results in 1.5607966601082315.
Hyperbolic Sinus (sinh)
the hyperbolic sine of the given value. The hyperbolic sine of x is
defined to be (ex - e-x)/2 where e is Euler's
results in 27.28991719712775.
the hyperbolic cosine of the given value. The hyperbolic cosine of x
is defined to be (ex + e-x)/2 where e is Euler's
results in 1.543080634815244.
the hyperbolic tangent of the given value. The hyperbolic tangent of
x is defined to be sinh(x)/cosh(x). Note that the absolute value of
the exact tanh is always less than 1.
results in 0.9640275800758169.
Converting Radians to Degress
an angle measured in radians to an approximately equivalent angle measured
results in 180.0.
Converting Degrees to Radians
Converts an angle measured in degrees to an approximately equivalent
angle measured in radians.
results in 6.283185307179586.
Rounds the given value to the closest integer.
results in 12.0.
Returns the largest integer which is less or equal to the given value.
results in 11.0.
constants are recognized:
pi : equals 3.141592653589793.
e : Euler's Number, equals
Specify a number in a different base
You can specify a number in an arbitrary base (between 2 and 36) by
appending an '@' followed by the base.
Example: 1101@2 means
to interpret 1101 in base 2 which results in 13.0.
Of course, you can uese such expressions everywhere where you are able
to use base10 numbers:
Example: 11@2 * ff@16
+ a@17 results in 775.0.
Specify the result in a different
If you want to receive the result also in another base than base 10,
you can check the checkbox under the expression field and select your
additional desired base from the dropdown list.
About / Info
was originally coded for personal reasons cause I always forgot to take
along my hand calculator and the windows/linux calculators do not satisfy
my needs nor are they comfortable to use. After finishing coding I decided
to make it public in case someone else finds it useful.
I am gonna to release the full source code somewhere in future, but
not before all bugs are removed - therefore I need your help:
find any bugs, have suggestions or commens - please mail me:
July 2008: Version 1.0
* Initial release
5th September 2008: Version
two small bugs in the parser
* added the autocompletion feature
December 2008: Version
::Download:: (120 kb) - applet, source, manual