Access your library from anywhere and share functions and scripts with others at www.calclibrary.com.
Enter an expression to calculate in the "input line" and press enter or press the "=" button. If there were no errors, the expression and the answer will appear at the top of the "history area. You can also just press the Enter key (or Ctrl-Enter when using the multi-line input). Holding down shift will force the calculation into floating point ("approximate") mode.
If a calculation takes too long (for example, if you accidentally create an infinite loop), you can press the Escape key or click on the "=" button again to cancel the operation.
You can also run commands from a text file on your computer. Just choose "Load..." from the menu and choose a script to run. Remember to separate statements with a semicolon.
To copy a previous calculation from the history, use the arrow keys to select the calculation you want and press "enter" or "space" to copy the expression into the input area, replacing the current selection. You can also click on the input or answer.
Use the "Exact" and "Approximate" buttons to control whether answers should be exact (if possible) or approximate (i.e. show fractions in decimal notation). The "Clear History" button does exactly what its name suggests.
SciCalc supports several numeric types including integers and fractions, which are exact, and floating point numbers, which are considered inexact because not every real number can be represented. Complex numbers can also be either exact or inexact, but if either the real part or the imaginary part is inexact, the entire number will be considered inexact.
Any number with a decimal point or exponential notation is inexact by default. For example, 123.45
, 1e5
, and 2.0
. You can "force" numbers to be either exact or inexact by prefixing them with "#e
" and "#i
" respectively. So #e12.5
turns into 25/2
and #i123
is the same as 123.0
.
Numbers can be input in binary, octal, or hexadecimal by prefixing them with "#b
", "#o
", and "#x
". Fractional parts are allowed and the same rules for exactness apply. Exponential notation is not allowed for hexadecimal though because it would be ambiguous (does #x3ef
mean 3*256 + 14*16 + 15
or 3 * 16^15
?).
It's important thing to remember is that "e
" stands for "times the-radix to the _ power", so #b101e100
is 5 * 2^4
not 5 * 10^100
.
To run code from a file on your computer, choose "Load..." from the menu, open the file chooser under the "From a file" section, find your file, and press "Load".
If you plan to load the same file often, it can be useful to save it in your library to make it easier to find. To save the file to your library, check the box next to "Save to library as" and enter a name. The script will automatically be added to your library when it's loaded.
If The script library can be used to save commonly functions or variables so you don't have to keep typing them in every time you need them.
To create a script, open the menu and select "Edit Library". A list of any existing scripts will appear. You can select the script you want to edit or press the "New" button to create a new script. In the "New Script" dialog, enter a script name (made up of numbers, letters, periods, hyphens, or underscores). Enter the code to run when you load the script and save it.
You can also save a file from your computer into your library when you load it.
To run a script from your library, open the "Load..." dialog from the menu, and choose the script to run from the list.
You can also load saved scripts in code with the load function: load("your-script-name")
.
To delete a script, hover over the script and press "delete" on the right side of the list.
If you have a script named "startup" (case sensitive), it will automatically run every time you launch the calculator.
SciCalc supports the most commonly used mathematical functions and arithmetic operators.
(<expr>) | Grouping |
---|---|
[<expr>, <expr>, ...] | List literal (semicolons can be used as a shortcut for nested lists/matrices) |
[... | m] | Augmented matrix |
|<expr>| | Absolute value |
fn([<expr>, ...]) | Function call |
matrix([<expr>, ...]) | Matrix indexing (1-based) |
list[n] | List indexing (0-based, assignment is allowed) |
list[start..end] | List slice by an interval (0-based, assignment is allowed) |
list[fn] | List filtered by a function (assignment is allowed) |
x! | Factorial of x: x * (x-1) * (x-2) * ... * 1 |
m' | Matrix transpose |
x deg, x rad | Force an angle to degrees or radians |
x^y | Exponentiation (right to left) |
x.^y | Element-wise exponentiation (right to left) |
f.g | Function composition, f(g(x)) |
-x, +x, not x | Negation, identity, logical NOT, and other prefix function operators |
x*y, x/y, x mod y | Multiplication, division, modulo |
x y | Multiplication |
x.*y, x./y | Element-wise multiplication and division |
xi | Multiplication by i |
x+y, x-y | Addition and subtraction |
x.+y, x.-y | |
a .. b | Construct the half-open interval [a, b) |
a ... b | Construct the closed interval [a, b] |
x==y, x!=y, x<y, x<=y, x>y, x>=y | Equal, not equal, less than, less than or equal, greater than, and greater than or equal |
x===y, x!==y | Identity (lists/matrices are references to the same list/matrix, numbers are equal and have the same "exactness", +nan.0 === +nan.0) |
Comparison operators can be chained, e.g. "0 <= n <= len x ", which is equivalent to "0 <= n and n < len x " except "n " is only evaluated once. | |
x in <list/string/inverval> | Searches a list, string, or interval for a specific value. Not Chainable |
x <=> y | Returns -1, 0, or 1 if x is less than, equal to, or greater than y. x and y must be real numbers, booleans, strings, or lists. Not Chainable. |
x and y | Logical AND, true if both x and y are true (right to left) |
x or y | Logical OR, true if either x or y is true (right to left) |
x ? y : z | Conditional, y if x is true, z otherwise |
if x -> y [else z] | If/else conditional, y if x is true, z otherwise. The else part is optional and defaults to null. Conditionals can be changed to create if/else if/else structures. |
while (<expr1>) -> (<expr2>) | Evaluate <expr2> as long as <expr1> evaluates to true. |
for <const> in <list/string/interval> [by step] -> (<expr>) | Loop over each value in the list or interval, with an option "step" value. |
try <expr1> catch (<const>) -> <expr2> | Try to evaluate <expr1>, but evaluate <expr2> if there's an error (with the error message in <const>). |
<expr> where a=b, c=d, ... | Evaluate <expr> in a new scope, containing a, c, etc. as constants. Constants can also be assigned with the ":=" operator. |
x:=y, x=y | Definition and assignment (right to left) |
x+=y, x-=y, x*=y, x/=y | x=x+y, etc. (right to left) |
<expr1>; <expr2> | Evalutate <expr1> then give <expr2> as the result |
Additionally, the special ":
" operator can be used to convert (most) other operators, literals, and names into functions.
You can use the colon operator to pass operators as arguments to other functions, compose them, assign them to variables (e.g. var sum = :+
), etc.
Most of the resulting functions can take "extra" arguments, for example: :+(1,2,3,4)
is equivalent to 1+2+3+4
.
:+
, :-
, :*
, :/
all work as unary as well as binary/n-ary functions.
Calling :/
with one argument returns the inverse (i.e. :/(x) == 1/x
).
Calling :+
and :*
with no arguments results in 0 and 1 respectively.
:<literal/variable>
is equivalent to function() {<literal/variable>}
.
For example, (:42)() == 42
, :y() == y
, etc.
Most of the operator-function conversions should be fairly obvious, but there are a few that may require explanation.
:()
is the identity function and simply returns it's first argument.:[]
returns all its arguments as an array.:||
returns the absolute value of its first argument.:;
(colon-semicolon) returns its last argument.:<
, :<=
, etc. return true if each pair of values is the specified relationship.:==
and :!=
return true iff all the values are equal and true iff at least one value is not equal to the others respectively.Here is a "real life" example of how this could be used. It defines a function to calculate the (mean) average of a list by passing each list element to the addition function and divides by the length of the list.
avg=function(list){ apply(:+,list) / len list }
You would call it like this: avg([3, 4.5, 2/5, 5.1])
Variable/constant names consist of letters, numbers, and underscores ("_") and must begin with a letter.
The "var" operator creates a new variable, and takes an optional initial value, for example, "var x; var y = 4". Trying to access a variable that hasn't been created yet is an error; assignment to an undefined variable will create it in the current scope.
Likewise, the "const" operator creates a new constant. The "initial" value is required for constants since they can't be assigned to later.
The ":=" operator can be used to create a lazily-evaluated variable or constant. The right-hand side is evaluated when the variable is accessed, not when it is assigned. For example, if you run "var x := 2 * y", "x" will always be equivalent to "2 * y", even if the value of "y" changes. The assignment could be read, "variable x is defined as 2 times y".
Multiple assignment is also possible, and lets you easily "extract" elements from a list. For example "var (first, second, ...rest) = [1, 2, 3, 4, 5]" would set "first = 1", "second = 2", and "rest = [3, 4, 5]". The "...rest" part is optional, but must be the last variable if it's included. If there are more variables than the length of the list, the extra variables will be null (or an empty list for "...variable" at the end).
An example of how this could be useful is the LU matrix decomposition function, which returns three results in a list. You can use multiple assignment to get the lower, upper, and permutation matrices in separate variables.
var (L, U, P) = LU([1, 2, 3; 4, 5, 6; 7, 8, 9]);
// L == [1, 0, 0; 4, 1, 0; 7, 2, 1]
// U == [1, 2, 3; 0, -3, -6; 0, 0, 0]
// P == [1, 0, 0; 0, 1, 0; 0, 0, 1]
Variables can optionally be added to a namespace instead of the current scope. To create a namespaced variable, prefix it with the namespace followed by a colon (with no spaces). For example: "var foo:bar = 5" adds the variable bar to the foo namespace (which is automatically created if it doesn't exist already).
The special namespace "global" is already defined and is equivalent to the global scope.
You can define your own functions with a JavaScript-like syntax: "var add = function(a, b) { a + b }". Functions are closures. That is, they keep a reference to any variables (including function parameters) that are in scope when they are created.
There's also a more compact function syntax that's useful for short, simple functions: "add = (a, b) -> a + b". If there is only one parameter, you can leave off the parentheses: "square = x -> x^2". Empty parentheses are allowed for nullary functions: "getAFour = () -> 4".
Functions can take any number of parameters. To access unnamed parameters, use the special array, "@". For example, the third argument is "@[2]".
Lists can hold any type of value, and are written as comma-separated values inside square brackets:
var myList = [1, 2, 3, 4, 5]
To access an individual item in a list, use square brackets around the numeric index like this: myList[0] == 1
.
Notice that the indexes start at zero.
To get a list slice (sub-list), you can either call the slice
function, or use the index operator with an interval:
myList[2..5] == [3, 4, 5]
If the interval is "backwards", the slice will be in revers order, so
myList[4...0] == [5, 4, 3, 2, 1] == reverse(myList)
You can assign to a specific element just like a variable to modify the list in place: myList[0] = 42
.
If the index is an interval, each element in the interval will get a copy of the assigned value, or if it's a list, the items from the list are copied into the corresponding index.
For example:
var myList = [0,1,2,3,4,5,6,7,8,9];
myList[5...9] = 0;
myList == [0,1,2,3,4,0,0,0,0,0];
myList[5...9] = [4,3,2,1,0];
myList == [0,1,2,3,4,4,3,2,1,0];
If the list is shorter than the slice you are assigning it to, elements will be repeated until each index is assigned.
A list that contains other lists, all of the same length, is a matrix. As a shortcut, you can separate the rows with semicolons instead of explicitly nesting the lists:
var magic = [8, 1, 6; 3, 5, 7; 4, 9, 2];
magic == [[8, 1, 6], [3, 5, 7], [4, 9, 2]];
Most built-in constants are in the "c" (for constant) namespace. pi and e are also available in the global namespace.
ans | The result of the most recent calculation |
---|---|
e, c:e | e: the base of natural logarithms |
pi, c:pi | π: the ratio of a circle's circumference to its diameter |
c:atm | Standard atmospheric pressure (101,325 Pa) |
c:c | The speed of light (299,792,458 m/s) |
c:euler | Euler–Mascheroni constant (≈ 0.577216) |
c:G | The gravitational constant (6.67384e-11) |
c:g | Standard acceleration of gravity (exactly 9.80665 m/s2) |
c:h | Planck constant (6.62606957e-34 Js) |
c:i | The imaginary unit (the square root of -1, i) |
c:inf | Infinity |
c:k | Boltzmann constant (1.3806488e-23 J/K) |
c:N_A | Avogadro constant (6.02214129e23/mol) |
c:NaN | Not a number |
c:phi | φ: the golden ratio (≈ 1.618034) |
The "where" operator creates a new scope that's local to the "where" expression. For example:
x + y where x = 4, y := 2*x
"x + y" above evaluates to 12 (4 + 2*4) and "x" and "y" only exist for the duration of that expression (unless you close over them with a function definition). The "where" operator is essentially a nicer way of defining and instantly calling an anonymous function. The above example is approximately equivalent to:
(function(x) { var y = 2*x; x + y })(4)
There are a few important differences though. First, the "where" operator creates constants instead of variables. Also, the expressions are evaluated in the new scope, which allows later constants to reference earlier ones (see "y := 2*x" in the example).
Note however that the constants are not added to the new scope until their value is assigned.
For example, this is valid: "var x = 5; x*x where x = x - 1;
". and evaluates to 16.
As a more practical example, consider this (incorrect) code to create a list of functions that show their index in the list:
var funcs = [];
var i = 0;
while (i < 10) -> (
funcs[i] = function() { alert(i) };
i += 1;
);
Since functions close over the current scope, each function keeps a reference to the same "i" variable, so all of them will show "10". The easiest way to fix it, is to create each function with it's own private copy:
var funcs = [];
var i = 0;
while (i < 10) -> (
funcs[i] = function() { alert(i) } where i = i;
i += 1;
);
Function operators do not require parentheses and bind at the same level as negation. So, for example, "sin x^2" is equivalent to "sin(x^2)", but "sin x*y" is "(sin x) * y".
Like other operators, these can be converted into regular functions by prefixing the function name with the special ":
" operator.
abs x | Absolute value of x |
---|---|
acos x | Arc cosine of x |
acosh x | Hyperbolic arc cosine of x |
arg z | Complex argument of z, in the range [-π, π] |
asin x | Arc sine of x |
asinh x | Hyperbolic arc sine of x |
atan x | Arc tangent of x |
atanh x | Hyperbolic arc tangent of x |
ceil x | Ceiling of x (smallest integer >= x) |
conj z | Complex conjugate of z |
cos x | Cosine of x |
cosh x | Hyperbolic cosine of x |
cot x | Cotangent of x |
coth x | Hyperbolic cotangent of x |
csc x | Cosecant of x |
csch x | Hyperbolic cosecant of x |
csign x | Complex sign/signum of x (x / sqrt(x^2)) |
dim matrix | Length of each dimension of a matrix |
exact x | Convert x into an "exact" number |
floor x | Floor of x (largest integer <= x) |
imag z | Imaginary part of z (as a real number, i.e. imag(3 - 4i) == -4) |
inexact x | Convert x into an inexact, floating point number |
len list | Length of a string or list |
ln x | Base-e log of x |
log10 x | Base-10 log of x |
real z | Real part of z (i.e. real(3 - 4i) == 3) |
round x | Round x to the nearest integer (rounding xxx.5 to even) |
sec x | Secant of x |
sech x | Hyperbolic secant of x |
sign x | Sign/signum of x (1, 0, or -1 for positive, zero, or negative) |
sin x | Sine of x |
sinh x | Hyperbolic sine of x |
sqrt x | Square root of x |
tan x | Tangent of x |
tanh x | Hyperbolic tangent of x |
alert(msg[, title]) | Show a dialog box with the specified message/title. |
---|---|
apply(f, list) | Apply function f to the arguments from list, i.e. apply(f, a) is equivalent to f(a[0], a[1], a[2], ...) . |
atan2(y, x) | Return the angle from (0, 0) to (x, y). |
augment(m1, m2, ...) | Augment matrix m1 with m2 |
bind(f, arg1...) | Creates a new function based on f with the initial arguments provided. |
bounds(interval) | Get the lower and upper bounds of an interval as a two-element list. |
char(n) | Convert from a Unicode value to its character equivalent, e.g. char(65) == "A" |
charCode(s) | Convert the first character of a string into its Unicode value, e.g. charCode("ABC") == 65 . |
chop(x[, delta]) | Convert x to an exact zero if it a floating point number with absolute value less than delta. delta defaults to 1e-10 . Works on complex numbers and lists/matrices. |
clamp(x, limits) | Restrict x to the interval, limits. In other words, return the value closest to x that's inside the interval, limits. limits is treated as closed. |
clamp(interval, limits) | Return the intersection of two intervals. |
classify(interval) | Get the type of an interval. One of "left", "right", "open", or "closed". |
clone(x) | Create a deep copy of its argument. This is just the identity function for most types, but it's useful to get a deep copy of a list. |
concat(a, b, ...) | Concatenate the string or list arguments. |
confirm(msg[, title]) | Show a dialog with a yes/no question and let the user answer. |
continuation() | Save a snapshot of the current execution state, and return a continuation function. Calling the returned continuation function will jump back to the initial call and return its argument. |
deleteNamespace(namespace) | Delete a namespace. Built-in namespaces like, global, string, etc. cannot be deleted. |
denominator(x) | Get the denominator of x (converted to a rational number). The denominator is always positive and has the same exactness as x. |
det(m) | Get the determinant of square matrix m. |
diagonal(m) | Get the diagonal of square matrix m. |
error([msg]) | Abort with an optional error message. |
every(f, list) | Return true if p returns true for every element in list. |
factor(n) | Return a list of the prime factors of n. n must be an integer. The first element will be -1 if n is negative, and elements will be exact iff n is exact. |
filter(f, list) | Return a list containing only the elements x from list where f(x) is true. |
finance:fv(rate, periods, payment, presentValue, dueAtStart) | Calculate the future value of an annuity. |
finance:npv(rate, values) | Calculate the net present value of a time series of cash flows. |
finance:pmt(rate, periods, presentValue, futureValue, dueAtStart) | Calculate the payments for a loan with constant payment amount and interest rate. |
finance:pv(rate, periods, payment, futureValue, dueAtStart) | Calculate the present value of an annuity. |
fold(f, init, list) | Fold/reduce list by calling the combining function f on the current accumulated value and each element. The current value is initialized to init. |
foldl(f, init, list) | Synonym for fold (fold left). |
foldr(f, init, list) | Same as fold/foldl except accumulates from right to left (fold right). |
fpart(x) | Get the fractional part of x with the same sign. Equivalent to x - ipart(x) , so ipart(x) + fpart(x) == x |
gcd(a, b, ...) | Greatest Common Divisor. |
identity(n) | Get the n-by-n identity matrix. |
import(namespace) | Copy the variables and constants from a given namespace into the current scope. For example, import("string") would add |
interval(start, end) | Construct the left-closed interval start..end. |
interval(start, end, "left") | Construct a left-closed interval, [start, end). |
interval(start, end, "open") | Construct an open interval, (start, end). |
interval(start, end, "closed") | Construct a closed interval, [start, end]. |
interval(start, end, "right") | Construct a right-closed interval, (start, end]. |
ipart(x) | Get the integer part of x with the same sign. Equivalent to floor if x is positive and ceil if x is negative. |
isContinuation(f) | Return true iff f is a continuation function. |
isEven(n) | Return true iff n is an even number. |
isInterval(x) | Return true iff x is an interval. For example, isInterval(3..4) == true , isInterval(3) == false |
isOdd(n) | Return true iff n is an odd number. |
isPrime(n) | Return true iff n is a prime number. |
lcm(a, b, ...) | Least Common Multiple |
list(x) | Convert x to a list. |
load(script) | Load a script from your library and return true if successful, and false otherwise. |
logn(n, x) | Base-n log of x |
LU(matrix) | Get the LU decomposition of a square matrix as a list, [L, U, P] where L is the lower diagonal, U is the upper diagonal, and P is the permutation matrix. |
map(f, list) | Map from "list of x" to "list of f(x)". |
max(a, b, ...) | Return the largest argument, or the upper bound of an interval. |
min(a, b, ...) | Return the smallest argument, or the lower bound of an interval. |
modPow(b, p, m) | Return b^p mod m. If b, p, and m are exact integers, the modular exponentiation is done to prevent overflow. |
nCr(n, r) | Return the number of combinations (without ordering) of n items taken r at a time. |
notify(msg) | Show a non-intrusive notification with the specified message. |
nPr(n, r) | Return the number of permutations (with ordering) of n items taken r at a time. |
number(s) | Convert s to a number, or false if parsing fails. |
numerator(x) | Get the numerator of x (converted to a rational number). The numerator has the same sign and exactness as x. |
ones(m, n, ...) | Create a list of length m or an m x n x ... matrix filled with ones. |
polar(r, theta) | Construct a complex number from polar coordinates. |
pop(list) | Remove and return the last element of a list. |
product(list[, f]) | Multiply all the elements of list and return their product. The function f (if provided) will be applied to each element before it gets multiplied. |
prompt(msg[, title, default]) | Prompt the user for some text, with an optional default value. |
push(list, x) | Append x to a list. |
random([x]) | Return a pseudorandom number in the range [0, x). x defaults to 1 if not provided. |
random(low .. high) | Return a pseudorandom number from an interval. |
random:bernoulli([p]) | Rturn a random boolean, with probability p of being true. p defaults to 0.5. |
random:exponential([lambda]) | Return a pseudorandom number with an exponential distribution. |
random:normal([mean, stddev]) | Return a pseudorandom number with a normal (Gaussian) distribution. mean and stddev default to 0 and 1. |
random:shuffle(list/string) | Return a copy of the list or string with the elements in a random order. |
random:uniform(...) | Return a random number from a uniform distribution. Identical to random(...) . |
range(count or start, end[, step]) | Generate a list from 0 to count (exclusive) or from start to end (exclusive) with an option step size. step defaults to 1 and can be negative. |
rationalize(x[, delta]) | Find the simplest rational number within delta of x. If unspecified, delta is 1/10000. Note that in "approximate" mode, the answer will still be converted to a floating point number. |
ref(m) | Return the row-echelon form of matrix m. |
reverse(list/string/interval) | Return a reversed list, string, or interval. |
rref(m) | Return the reduced row-echelon form of matrix m. |
seedrandom([x]) | Seed the random number generator (with a string). If no seed is provided, one will be generated automatically. Returns the seed. |
shift(list) | Remove and return the first element of a list. |
sleep([n]) | Stop execution (sleep) for n milliseconds, then resume. |
slice(list/string, start[, end]) | Return a substring or sub-list from start to end (exclusive). If end is not specified, it defaults to the length of the string or list. start and end can be negative to count from the end. |
some(f, list) | Return true if f returns true for at least one element in list. |
sort(list[, order]) | Return a sorted copy of list, in ascending order by default. order is a function that takes two arguments and returns -1, 0, or 1 when the first is ordered before, the same as, or after the second. As a shortcut, you can also pass 1 or -1 for ascending and descending, respectively. |
sortInPlace(list[, order]) | Sort list in place, in ascending order by default. order is a function that takes two arguments and returns -1, 0, or 1 when the first is ordered before, the same as, or after the second. As a shortcut, you can also pass 1 or -1 for ascending and descending, respectively. |
stats:correlation(X, Y) | Calculate the correlation between two lists. X and Y must have at least two elements and be the same length. |
stats:correlationp(X, Y) | Calculate the population correlation between two lists. X and Y must have at least two elements and be the same length. |
stats:covariance(X, Y) | Calculate the covariance between two lists. X and Y must have at least two elements and be the same length. |
stats:covariancep(X, Y) | Calculate the population covariance between two lists. X and Y must have at least two elements and be the same length. |
stats:mean(list) | Calculate the arithmetic mean of a list. |
stats:median(list) | Calculate the median of a list. If the list has an even number of elements, returns the average of the two central values. |
stats:std(list) | Calculate the sample standard deviation of a list. The list must have length >= 2. |
stats:stdp(list) | Calculate the population standard deviation of a list. The list must have length >= 2. |
stats:variance(list) | Calculate the sample variance of a list. The list must have length >= 2. |
stats:variancep(list) | Calculate the population variance of a list. The list must have length >= 2. |
string(x) | Convert x to a string. |
string:indexOf(s, pattern) | Return the zero-based index of pattern in s, or -1 if the pattern is not found. |
string:join(list, separator) | Convert the elements of list into strings and concatenate them, separated by separator. |
string:lower(s) | Convert s to lowercase. |
string:replace(s, pattern, replacement) | Replace all occurrences of pattern in s with replacement. |
string:split(s, separator) | Split string s into a list at every occurrence of separator. |
string:trim(s) | Return s with leading and trailing whitespace removed. |
string:upper(s) | Convert s to uppercase. |
sum(list[, f]) | Add up the elements of list and return their sum. The function f (if provided) will be applied to each element before it gets added to the total. |
system:assert(x[, message]) | Throw an error if x is false (or converts to false). |
system:getAngleMode() | Return the current angle mode: either "degrees" or "radians". |
system:setAngleMode(mode) | Sets the angle mode to either "degrees" or "radians" and returns the previous mode. Any other argument is an error. |
system:registerConstant(name[, description]) | Add a constant (by name) to the dropdown list with an option description. |
system:registerFunction(name[, description]) | Add a function (by name) to the dropdown list with an option description. |
system:type(x) | Get the type of a value as a string. |
system:unregisterConstant(name) | Remove a constant (by name) from the dropdown list. |
system:unregisterFunction(name) | Remove a function (by name) from the dropdown list. |
system:version() | Get the calculator version as a list. Currently, [1, 2, 0]. |
tally(list[, comp]) | Count the unique values in a list or string. Uses comp to compare values (default is (x, y) -> x == y ). Example: tally([1,2,2,3,2,0]) == [[1, 1], [2, 3], [3, 1], [0, 1]] |
time() | Get the current time in milliseconds since January 1, 1970. |
transpose(m) | Return the transpose of matrix m (i.e. mT). |
unshift(list, x) | Prepend x to a list. |
warning(msg) | Show a non-intrusive warning notification with the specified message. |
zeros(m, n, ...) | Create a list of length m or an m x n x ... matrix filled with zeros. |
You can access options by selecting the Menu button and choosing "Settings" from the dropdown menu.
Converts your input to mathematical notation. This should be more readable and is useful for making sure your input was interpreted as you intended.
Display mixed fractions instead of improper fractions, for example "1 1/3" instead of "4/3". Only applicable in exact mode.
Exact tries to keep answers exact whenever possible (all the values and all functions used are exact).
Approximate shows the final result as a decimal approximation, for example "1.3333333333333333" instead of "4/3".
Selects how many digits of to display for floating point numbers.
"Default" shows enough digits to uniquely represent the exact value of the floating point number.
The Floating Point option removes trailing zeros and rounds to the specified number of digits.
Fixed shows the specified number of digits after the decimal point (including trailing zeros), but no more than 17 digits total.
Auto uses "normal" notation for numbers until they are too large (around 1021) or too small (around 10-7), then switches to scientific notation.
For example, 0.0123456
or 9.876 x 1054
.
Scientific always uses scientific notation with exactly one digit to the left of the decimal point.
For example, 1.23456 x 10-2
.
Engineering always uses the exponential form, with one, two, or three digits to the left of the decimal point and an exponent that's a multiple of three.
For example, 12.3456 x 10-3
.
Choose the base used to display results (binary, octal, decimal, or hexadecimal).
Note that this setting does not affect the input format or the built-in string
function, which always uses decimal.
Use the #b
, #o
, and #x
prefixes to input numbers in alternate bases.
Shows the sidebar. Simple :)
Move the sidebar to the left or right side of the screen.
Check this to show usage tips when you start the calculator.
Check this to automatically save and restore previous calculations between sessions.
Set how many previous results to show in the history.
Setting this too high might impact startup times if the "Restore history at startup" option is enabled.
Switch between radian mode and degree mode for trigonometric functions.
Allow missing ")" characters at the end of an expression. This option could be removed in future versions.
Check this to use spaces for indentation instead of tab characters.
Set the number of spaces to use for indentation.
Choose Dark or Light theme for the library script editor. Note that this doesn't affect the input field.
Help improve the calculator by sharing anonymous usage statistics when you are connected to the Internet. No personally identifiable information, calculations, results, or any other personal data are sent over the Internet.
Would you like to help improve this program by sharing anonymous usage statistics?
(no personally identifiable information, calculations, or results will be shared, and you can disable tracking at any time in the settings)
Access your library from anywhere and share functions and scripts with others at www.calclibrary.com.