Overview

  1. The ans Variable
  2. Variable names
  3. Constants
  4. Rational numbers and integers
  5. Real numbers, Infinity and NaN
  6. Complex numbers
  7. Boolean expressions
  8. Arrays
  9. Miscellaneous functions

Use standard syntax to type an expression.
Press ENTER to execute.

Example:


4*7/(3-5/(3-7*3))
 504/59 

Use C/C++/Java syntax.
There is no need to declare variables.

Example:


x=4
4
5*x/(3+x)
20/7

Use a ";" to enter several expressions in one line.

Example:


x=4; 5*x/(3+x)
4
20/7

You may prefer doing this:


5*(x=4)/(3+x)
20/7

Variables can be redefined to be rational, real, complex, boolean, array, string, or matrix.

The sample session may continue like this:


x=(5, 6, 7)
5  6  7
y=(-3, 1, 3)
-3  1  3
z=x cross y
11  36  23

Variable x was redefined as an array of size 3 (arrays of size 3 are also treated as vectors.)

The ans Variable

The ans variable always has the value of the last successful calculation.

Example:


5*4
20
ans*2
40

Variable names

Valid variable names can be formed using letters, numbers, underscores, single quotes and backslashes. However, a variable name must not start with a number. Calcugator is case sensitive.

A Calcugator letter is defined as any unicode character that the java language recognizes as a letter. See examples below


x=77
77
A=5
5
a'=8
8
x*a'
616
_my_\s = 99.99
99.99

This example uses a Greek letter. Menu option File->Unicode Chooser... lets you enter unicode characters.


α=5
5
α*α
25

See the documentation of function shortcut() for details on how to enter unicode characters.

Constants

The following are predefined constants:

These constants can not be redefined.

Rational numbers and integers

If an expression involves only integers and/or rational numbers, the program will try to keep the result as an integer or a rational value. Common factors are simplified.

Examples:


A=3*(5, 7/3, 3/2, 1/7)
15  7  9/2  3/7
B=(1, 2, 3 ; 4, 0, 0 ; 0, 1, 2)
1  2  3
4  0  0
0  1  2
inverse(B)
 0  1/4  0
 2 -1/2 -3
-1  1/4  2

The following operators or functions can be used with integers and rational numbers:

Real numbers, Infinity and NaN

Every number entered with a period or in exponential format is treated as a real number.

Every operation involving at least one real number makes the result real.

Precedence and associativity of arithmetic operators follow strict C/C++/Java conventions.

The following operators and functions are implemented:

Numerical exceptions are never thrown.
You may work with infinite values and NaN (not a number).

Example:


1/0
Infinity
asin(3)
NaN
atan(-1/0)
-1.5708

Infinity and NaN may be assigned to variables.

Example:


x = -Infinity
-Infinity
3*x
-Infinity
sin(NaN)
NaN

Complex numbers

Enter complex numbers using the predefined variables i or j.

Example:


z = 3 + 3j
3.0000 + 3.000 j
sin(z)
1.4207 - 9.9176 j

NOTE: To enter imaginary parts make sure a number precedes the imaginary constant:


// OK, Re(z)=4 and Im(z)=1
z=4+1j
(4.0 + 1.0 j)
// May generate an error because it is
// interpreted as the sum of variable "j" and 4
z=4+j

All functions which work for real numbers, also work for complex numbers.

Functions asin(x) and acos(x) return NaN if the argument x is real and it is outside the interval [-1.,1.].
However, if you need a complex result, add a 0j to the argument to have a complex result.

Example:


asin(1.2)
NaN
asin(1.2+0j)
1.5708 - 0.6224 j

The following functions accept complex arguments:

Boolean expressions

All C/C++/Java boolean operators are supported.

Example:


a = 3<5
true
a && false
false
(2<=5 || 4>-1) && (asin(.707)<pi/2)
true

Arrays

Create an array as follows:


v=(2,4, 5, 6, -3, 9)
2  4  5  6  -3  9

A quick way to create an array is to create a specific entry:


D[8] = 5
5
D
0  0  0  0  0  0  0  5

Arrays can be resized by creating an entry at a new position:


D[12]=-4
-4
D
0  0  0  0  0  0  0  5  0  0  0  -4

Use the [] operator to dereference any entry of an array inside algebraic expressions.

You may also create arrays using the array function:

where n is the size of the array to create. The value for the first entry is x1, the value for the last entry is x2 and the values of the remaining entries are found by linear interpolation. If x2 is missing, all entries will have the value x1.

Use arithmetic operators + and - provided the arrays are of the same size.

You may multiply and divide arrays times scalar values (rational, real, complex) using the * and / operators.

The following functions can be used with array arguments:

Miscellaneous functions

The following functions are implemented:

The properties that may be set and the type of the parameter needed are the following:

Property formatSignificantDigits refers to the number of significant digits used to print a number in engineering format.
Property formatUpperBound is a positive value; if the absolute value of a number x is bigger than formatUpperBound, the exponential format is used to print the value of x; if the absolute value of x is less than formatUpperBound, then x is printed using as many decimals as formatDecimalPlaces.
Integers don't follow the rule above, they are printed using the maximum number of digits possible.