Calculator help

Basic usage

Input commands to the input field at the bottom. Execute the command by pressing Enter or by clicking the Calculate button. The large text area shows the history of input and output text.

While in the input field, you can scroll the command history back and forth with the up and down arrow keys.

You can clear the output window and command history by clicking the Clear button.

Operators

The calculator understands basic operations, which are:

+addition
-subtraction
*multiplication
/division
%modulus
^power

For example:

1 + 2 * 3 ^ 4

calculates 1 + 2 * 34, which is 163.

Variables

You can assign values to variables and use variables in expressions, for example:

x = 5
x + 6

Assignment operations can be also combined with the basic operations:

x += 5
x -= 6
x *= 7
x /= 8
x %= 3
x ^= 2

Output format

You can change the output format of floating-point values with the "Floating" and "Fixed" radio buttons. These are for example:

Floating:1.2345e3
Fixed:1234.5

Note that the calculator supports extremely large exponents for floating-point values. Displaying such numbers in the fixed-point format may be impractical.

Functions

The calculator supports many functions.

Basic:

abs(x)Absolute value of x.
cbrt(x)Cube root of x.
ceil(x)Ceiling function (round towards positive infinity) of x. Parameter x must be real.
copySign(x, y)Copies sign of y to the value of x. Both x and y must be real.
factorial(x)Factorial of x, that is x!. Parameter x must be an integer.
floor(x)Floor function (round towards negative infinity) of x. Parameter x must be real.
frac(x)Fractional part of x. Parameter x must be real.
fmod(x, y)Modulus, equivalent to x % y. Both x and y must be real.
hypot(x, y)Equivalent to sqrt(x2 + y2). Both x and y must be real.
inverseRoot(x, y)Equivalent to x-1/y. Parameter y must be an integer.
inverseRoot(x, y, z)Inverse y:th root of x, z:th branch. Parameters y and z must be integers.
max(x, y)Maximum of x and y. Both x and y must be real.
min(x, y)Minimum of x and y. Both x and y must be real.
n(x, y)The value of x to the precision of y digits. Parameter y must be an integer.
nextAfter(x, y)The number adjacent to x in the direction of y. Both x and y must be real.
nextDown(x)The adjacent value closer to negative infinity. Parameter x must be real.
nextUp(x)The adjacent value closer to positive infinity. Parameter x must be real.
random(x)Pseudorandom number with x digits and a uniform distribution from the range [0, 1). Parameter x must be an integer.
randomGaussian(x)Pseudorandom number with x digits and a normal distribution with mean 0 and standard deviation 1. Parameter x must be an integer.
root(x, y)Equivalent to x1/y. Parameter y must be an integer.
root(x, y, z)y:th root of x, z:th branch. Parameters y and z must be integers.
round(x, y)Round x to y digits of precision. Parameter x must be real and y must be an integer. Any exactly half-way values are rounded up.
scale(x, y)Equivalent to x * 10y. Parameter y must be an integer.
sqrt(x)Square root of x.
truncate(x)Nearest integer rounded towards zero of x. Parameter x must be real.
toDegrees(x)Convert radians to degrees. Parameter x must be real.
toRadians(x)Convert degrees to radians. Parameter x must be real.
ulp(x)Unit in the last place.

Trigonometric:

acos(x)Arc cosine of x.
acosh(x)Hyperbolic arc cosine of x.
asin(x)Arc sine of x.
asinh(x)Hyperbolic arc sine of x.
atan(x)Arc tangent of x.
atan2(x, y)Angle of the point (y, x). Both x and y must be real.
atanh(x)Hyperbolic arc tangent of x.
cos(x)Cosine of x.
cosh(x)Hyperbolic cosine of x.
exp(x)Exponent function of x, that is ex.
log(x)Natural logarithm of x.
log(x, y)Base-y logarithm of x.
sin(x)Sine of x.
sinh(x)Hyperbolic sine of x.
tan(x)Tangent of x.
tanh(x)Hyperbolic tangent of x.

Complex manipulation:

arg(x)Angle on the complex plane of x.
conj(x)Complex conjugate of x.
imag(x)Imaginary part of x.
real(x)Real part of x.

Advanced:

agm(x, y)Arithmetic-geometric mean of x and y.
euler(x)γ calculated to x digits of precision. Parameter x must be an integer.
gamma(x)Gamma function, i.e. Γ(x). Note that the implementation is slow.
gamma(a, x)Incomplete gamma function, i.e. Γ(a, x). Note that the implementation is slow.
gamma(a, x1, x2)Generalized incomplete gamma function, i.e. Γ(a, x1, x2). Note that the implementation is slow.
w(x)Lambert W function, i.e. solution to the equation W eW = x.
w(x, k)Lambert W function, branch k. Parameter k must be an integer.
gcd(x, y)Greatest common divisor of x and y. Both x and y must be integers.
lcm(x, y)Least common multiple of x and y. Both x and y must be integers.
pi(x)π calculated to x digits of precision. Parameter x must be an integer.

Functional equivalents to the basic operators:

add(x, y)Equivalent to x + y.
subtract(x, y)Equivalent to x - y.
multiply(x, y)Equivalent to x * y.
divide(x, y)Equivalent to x / y.
negate(x)Equivalent to -x.
mod(x, y)Equivalent to x % y.
pow(x, y)Equivalent to x ^ y.

For example:

digits=40
exp(sqrt(n(163, digits)) * pi(digits))

Number types

The calculator supports complex and rational numbers in addition to integers and floating-point values. For example, sqrt(-1.0) returns i. Here i is the imaginary unit and it can be used in input expressions as well. If you don't specify an exponent or a decimal point for a number, it will be treated as an integer. Integers have infinite precision (see below). For example, inputting

2/3

will get you just

2/3,

the rational number. If you want a floating-point calculation instead, use e.g.

2.00 / 3.00

Precision

The calculator can perform calculations to arbitrary precision (actually the precision is currently limited to about 3.5×1015 digits).

Arbitrary input precision

By default, the precision of a floating-point number is the number of significant digits that you specify for it. For example:

2. has a precision of 1 digit,
2.0 has a precision of 2 digits,
2.00000 has a precision of 6 digits

The result of the calculation is only performed to the precision allowed by the precision of the input operands, so for example

sqrt(2.00)

calculates the square root of two to three digits of precision.

Integers have infinite precision. This limits their use in certain operations. For example

sqrt(2)

will give an error that an inexact square root can't be calculated to infinite precision. However, sqrt(4) would work.

If you want to use extreme precision (which this calculator is certainly designed for), you can use the function n(x, y) to specify the precision of a number. For example,

sqrt(n(2, 1000))

would calculate the square root of two with a precision of 1000 digits.

If you set the precision very high, the calculation may take a very long time. During the calculation the calculator may appear unresponsive. For example, calculating

exp(n(1, 1000000))

might take an hour or so, depending on your computer's performance.

Fixed input precision

You can change the input precision of numbers from the above default logic to a fixed number of digits by selecting the "Fixed" radio button in the "Input precision" radio button group and setting the desired number of digits in the input field.

This way, if you e.g. set the input precision to 100 digits, even if you input a number like 0.5 it won't have only one digit of precision but always the fixed precision (e.g. 100 digits).

Note that the fixed precision is set only for the numbers that are input, not for the numbers that are output. In practice, often the two precisions are the same, but not always. For example, if you set a fixed input precision of 20 digits and calculate log(1.00001), the result won't have 20 digits of precision but only 15 digits of precision. This happens because of how the log() function behaves around 1.