 # Documentation and reference

• Go back to main page

• ### Here are some basics of Opalcalc(the table at the bottom of the page covers much more)

OpalCalc is very easy to use. Type in the left half of the window, and the answers appear in the right half on the fly. Because it works like notepad or your word processor, you can see multiple questions and answers all at once, and they can even reference each other. It's like a spreadsheet but much easier and simpler.

When you start up the program for the first time, you will see a tutorial. Work through that for a good working knowledge of how OpalCalc operates. After that, you may want to look at some of the basic examples by selecting one of the "Example sums..." menu items from the help menu. For some basics read the below section, or to see the giant searchable reference section, scroll near the bottom of this page.

• Using add, minus, multiply and divide
• Restore factory settings
• Units and currency
• Dates and times
• Using in built functions
• Working with variables
• Creating custom functions

• ### Using add, minus, multiply and divide

For the people not used to using their keyboard as a calculator, here's some basics:

The - + / * symbols (minus, plus, divide, multiply) are on your keyboard though you may have to hold down the Shift key while pressing the required symbol. For example, in the US, you can obtain the symbol + by pressing Shift and then the = key). Also remember the # key is a shortcut for plus. Here is a small reference (at least for the US and many other countries).

 Shift+Equals key (or simply press #) Add + Minus key Minus - Shift+8 key Multiply * Slash key Divide /

The letter 'x' will also act as multiplication, unless the option 'PC symbols' is ticked.

### Restore factory settings

Feel free to experiment with OpalCalc, because there's a great option in the help menu called "Restore factory settings". This undoes any previous setting changes you've made, so that OpalCalc will operate 'normally'.

Just type "ans" or "answer" and the new line will use the previous answer as part of the new sum. You can also press + at the start of a new line, and the previous answer will be automatically inserted.

### Units and currency

Hundreds of units are available from the 'Pi' dropdown button menu in OpalCalc (be patient while hovering over 'Units' as C# populates the giant list). Everything is here such as £,\$, inches, centimetres, newtons and miles/hour. Select one, and OpalCalc will write it in the main calculator display. If you want to convert a sum to another unit type, simply use the "as" or "in" keyword. For example: "50 usd + 50 gbp", or "\$5 in £", or "5cm as inch". If you want to use square or cubed units, try typing something like cm3 or inch3).

### Dates and times

OpalCalc can work with dates and time too, if you put a @ symbol at the beginning. See the main table at the bottom of this page for more info, but here are a few examples to kick start you off:

• @ 11:00 to 13:51 as minutes
• @ 3pm to 5pm
• @ 16/11/2011 + 10 weeks
• @ 16 oct 2011 + 30 days
• @ now + 1 hour + 1 second
• @ today - 7 days
• @ t = 5pm
• ### Using in built functions

...is easy. If you want to find the squareroot, cosine or average of a number/s for instance, just type:

• sqrt(25)
• cos(0.5)
• average(10,20,60)

...or even...

• sqrt 25
• cos 0.5
• average 10,20,60

This second example above shows you don't have to type the brackets (at the slight cost of clarity if you start to extend the sum further).

Be careful not to use the thousands separator (the comma or semicolon for some countries) inside functions (it'd get mixed up with the function delimiter which is also a comma).

• ### Working with variables

It's easy to define a variable in OpalCalc. A variable is a "storage place" so that you can use the sums in a later calculation. For example:
• n = 5
• n + 1             '(answer is 6)

You can also use words, percentages, and currencies too:

• carpet = 50 metres
• extra = 10%
• carpet + extra             '(answer is 55 metres, since 50 metres + 10% = 55 metres)

• piano = \$5,000
• piano + \$100             '(answer is \$5,100)

For storage purposes (between sessions of OpalCalc), it's possible to save variables to the corresponding 'userVariables.txt' file which can be opened from the 'Pi' button menu. Make sure to save the text file and reboot OpalCalc so that it can load the new variable/s in.
• ### Creating custom functions

The table further below contains a list of the built-in functions. If you want to create your own functions, you would use something like "plusfive(x) = x+5" (without the quotes). Now when you want to use that function later, just type plusfive(10), and the answer will appear as 15.

All custom user functions are kept in a file called "userFunctions.txt" which can be opened from the 'Pi' button menu. Usually, you would simply create the functions directly in OpalCalc, but the advantage of editing this text file directly is you can create functions with For/While loops and more complicated constructs. Make sure to save the text file and reboot OpalCalc so that it can load the new function/s in. Also note that functions in this text file should be written in Javascript.

## All help in one handy table(currently sorted by most common functions/menu options)

 The below table contain all menu options, commands, and functions available in OpalCalc. Simply type a word or two in the search box below, and the window will instantly filter your results, and provide related help. By default, the table is sorted by the * column. This represents how commonly used a function is, so the higher entries will be more likely to be of interest to you. If you want to search only menu commands, simply type: menu (plus whatever other search term you wish) into the search bar. Same principle with other options - if you want to search only for functions, type: function (and something else) etc. etc. If you're still stuck, feel free to email me directly.

Function *DefinitionNotesExamplesTypeExtra tags
+10Plus: Adds numbers togetherSimply press the # key as a shortcut. Alternatively, for many keyboards (including US), hold down the shift key and press equals (or press the + on the keypad) to get this sign5+5 = 10
1+2+2 = 5
-10Minus: Subtracts numbers from each otherFor most countries, the minus key is next to the + key on your keyboard10-5 = 10
10-2-3 = 5
operatortake away, subtraction, negative
* or ×10Multiply: Multiplies numbers togetherThis key looks like a star * on your keyboard2*2 = 4
10*2*5 = 100
operatormultiplication, times
/ or ÷10Divide: Divides numbers from each otherThis key looks like a slash / on your keyboard10/2 = 5operatordivision
. or ,10Decimal point: Allows for fractionsMany regions such as Europe, South America, or Russia use the comma as a decimal point (and the semicolon as a list separator). OpalCalc will automatically cater for this.4.5÷2 = 2.25
4,5÷2 = 2,25
miscdot, period, full stop
(9Open bracket: Allows certain calculations to be performed firstTIP: Use the square bracket keys to avoid having to press Shift and 8 or 92+(2*3) = 8
(2+2)*3 = 12
((1+1)*3)^2 = 36
operatorcurly, parenthesis
)9Close bracket: Allows certain calculations to be performed firstTIP: Use the square bracket keys to avoid having to press Shift and 8 or 92+(2*3) = 8
(2+2)*3 = 12
((1+1)*3)^2 = 36
operatorcurly, parenthesis
^8Exponentiation: Raises a given number to the power of another5^2 = 25operatorexponent
_7Logarithm: Lowers a given number to the logarithm of anotherShortcut for log(n,base)25_5 = 2operator
'9Ignore line onwards: Anything to the right of this symbol is ignored (even numbers)See example to the right. The "5+5" bit is calculated, but not the "+7" and text section is ignored (answer therefore is 10, not 17).5+5 ' +7 : (after quote is ignored).operatorquote out, english, add words, language, add comments, commenting, add notes, annotate, add annotation, anotate, add anotation, //, /*, */
; or :9Ignore line behind: Anything to the left of this symbol is ignored (even numbers)Either can be used, except for regions which use the semicolon as a list separator (e.g. in functions), then only the colon can be used for this 'Ignore Line Behind' operator. The : symbol is also used in time operations to represent hour:min:sec, so it won't perform as usual then.Cost for Monday: \$20operatorquote out, english, add words, language, add comments, commenting, add notes, annotate, add annotation, anotate, add anotation, //, /*, */
!6Factorial or Logical NOT: Depending on context, ! represents Factorial or Logical NOTFactorial operator also allows decimal input since the gamma function is used4! = 24
4.5! = 52.342778
true && !false = true
operatorprogrammer, exclamation mark
%8Percent: Performs a common percentage on preceding calcs% attempts to operate as most people would use it50 + 10% = 55
10%+10% = 20%
2%8 = 25%
operatortax, interest, percentage
\4RPN symbol: Use this \ symbol on the same line you work with reverse Polish NotationSee http://en.wikipedia.org/wiki/Reverse_Polish_notation for how RPN works. Use the thousands separator to delimit numbers/operators (may be a comma or a dot).Also start the sum off with a backslash symbol.\ 5,3,+ = 8
\ 2,3,^,5,6,*,/,10,+ = 10.266667
misc
@8Time symbol: Use this @ symbol on the same line you work with times and datesThis is needed to get OpalCalc to change the meaning of certain symbols (such as . - / : ) which otherwise would be treated differently (e.g. the symbol / would mean divide usually when here we want to use say, "10/01/2012").

It's sometimes possible to use other formats, but try to use your own country's format to represent time (e.g. say, dd/mm/yyyy, mm/dd/yyyy, or dd-mm-yyyy for the UK, US, and India respectively). Daylight saving time (DST) is automatically accounted for too (unless using one of the date only formats (no time) where it isn't taken into account to avoid potential confusion). Converting between time zones isn't yet possible, but is on the cards.

Also see home page pictures for good use of time (e.g. a diary or work schedule). TIP: You can press Ctrl+D, or Ctrl+T, or Ctrl+B to insert the current date/time.
@ 4pm to 6pm
@ 10:00:00 to 12:34:56
@ 10/11/12 to 11/11/12
@ 4pm + 5hours
@ 10:00 to 13:51 as minutes
@ 3pm to 5pm
@ 16/11/2011 - 10 weeks
@ 10/10/10 20:00:00 - 1hour
@ 16/11/2011 - 16/10/2011
@ 16 oct 2011 + 30 days
@ 4pm 22nd november
@ 2012-12-16
@ 2012/12/16
@ 16.11.2012
@ 10:00
@ 10:00:00
@ 1.10:00:00 ' 1 day and 10 hours
n = @ 4:00pm
n + 1 hour
@ n + 8:00:20
etc. etc.
miscclock, calendar, dst, daylight saving time, let's scrap daylight saving time to save sanity
[Subscript numbers]7Press Ctrl plus any number to obtain subscript numbers (if the font set used supports it)Subscript numbers are useful for defining variablesmiscsmall number, variable, subscript
[Custom functions]7Create user-defined functions directly through OpalCalc, or in the special userFunctions.txt file in JavascriptIf you want to create your own functions, you would use something like "plusfive(x) = x+5" (without the quotes). Now when you want to use that function in that session, just type plusfive(10), and the answer will appear as 15.

If you want to store your custom user functions permanently, then there is a file called "userFunctions.txt" which can be opened from the 'Pi' button menu. The advantage of editing this text file directly rather than through OpalCalc is you can create functions with For/While loops and more complicated constructs (but make sure to save the text file and reboot OpalCalc so that it can load the new function/s in).
---- Directly in OpalCalc:
plusfive(x) = x+5

---- Or in the corresponding text file:
function plusfive(x) { return x+5; }
miscuserdefined
[Custom variables]8Create user-defined variables directly through OpalCalc, or in the special userVariables.txt fileYou can also use words, percentages, and currencies too.

For storage purposes (between sessions of OpalCalc), it's possible to save variables to the corresponding 'userVariables.txt' file which can be opened from the 'Pi' button menu. Make sure to save the text file and reboot OpalCalc so that it can load the new variable/s in.
n = 5
n + 1 '(answer is 6)
carpet = 50 metres
extra = 10%
carpet + extra '(answer is 55 metres)
piano = \$5,000
piano + \$100 '(answer is \$5,100)
miscuserdefined
[Superscript numbers]5Use superscript numbers to create an alternative way of exponentiationThe usual method of exponentiation in Opalcalc is to use the caret ^ operator (e.g: 4^3), but alternatively, you can press the Ctrl key followed by a number. However, this method does not currently support variables.5Â˛ = 25miscnotation, exponent, power of
, or ;7Parameter delimiter: Commas are used to separate numbers in a functionThe comma is more common to use. However, regions such as Europe, South America and Russia will be using the semicolon for the same functionality.average(2,3,4,5) = 3.5
average(2;3;4;5) = 3,5
operator
=7Variable assign: Variables can be given a number so as to be used latertax=10% (equals is typed)
n=50 (equals is typed)
n+tax (equals fifty five)
operatorassignment
==6Equality: Tests two values for equality5==5 = True
5==6 = False
operatorprogrammer, boolean
&&6Logical AND: Tests two values to see if both are True5>3 && 3>2 = Trueoperatorprogrammer, boolean
||6Logical OR: Tests two values to see if either is True5>3 || 2>3 = Trueoperatorprogrammer, boolean
<6Less than: Tests two values to see if the 1st is less than the 2nd4<3 = Falseoperatorprogrammer, boolean
>6More than: Tests two values to see if the 1st is more than the 2nd3>4 = Falseoperatorprogrammer, boolean
&4Bitwise AND: Performs a bitwise AND5 & 3 & 1 = 1
2`111 & 2`011 & 2`001 = 1
|4Bitwise OR: Performs a bitwise OR4 | 2 | 1 = 7
2`100 | 2`010 | 2`001 = 7
^ (with programmer syntax on)4Bitwise XOR: Performs a bitwise XORThe ^ symbol will usually mean Exponential unless programmer syntax is switched on5^3 = 6
2`101 ^ 2`011 = 6
operatorprogrammer, caret
` (backtick symbol)5Number base sign: Allows definition of numbers in other basesAny number can be used from 1 to x (1 to 36). For hexadecimal, precede numbers with g` or x` (e.g. x`0f). In the input, you can calculate with different bases at once.

You can change the output base in two ways, either from the options (cog) window, or temporarily by adding "as" and the base at the end (e.g.: "as x`" or "as hex", or "as 2`".
x`10 + x`10 = 32
2`1000 + c`5a2.6 = 850.5
255 as hex = g`ff
255 as g` = g`ff
255 as x` = g`ff
255 as 2` = 2`10100
operatorbase 2, base 8, base 16, base 12, hexadecimal, octal, duodecimal, binary, programmer
pow(n, exponent)8Exponentiation: n to the power of exponentUse a^b instead of this as a shortcutpow(2,6) = 64functionpower of
exp(n)4e^n exponentiation: Euler's number (e) to the power of exponentLess general than pow()exp(3) = 20.085537function
log(n,base)7Logarithm: Logarithm n (with arbitrary base)Use a_b as shortcut (e.g. 125_5 = 3)log(125,5) = 3function
log10(n)5Log base 10: Logarithm n (with base 10)log10(1000)=3function
log2(n)5Log base 2: Logarithm n (with base 2)log2(256)=8function
ln(n)5Log base e: Logarithm n (with base e)ln(2) = 0.693147function
sqrt(n)7Square root: Calculates the square root of nsqrt(n)=n^0.5sqrt(25) = 5function
root(n,root)5Arbitrary root: Calculates an arbitrary root of nroot(81,4) = 3function
if(condition, thenThis, elseThis)6IF condition: Executes 'thenThis' if condition is true else executes 'elseThis'Similar to the ternary operatorif(3>2, 1000, 2000) = 1000
if(1==2, 1000, 2000) = 2000
functionprogrammer, boolean
sign(n)6Sign: Returns 1 if n>0 and -1 if n<0 and 0 if n==0sign(-27) = -1functionsgn
abs(n)7Absolute: Removes the negative sign of a number if one existsmagnitudeabs(-27) = 27function
round(n)6Round: Rounds n to the nearest whole numberround(3.499) = 3function
roundm(n, order)5Round to magnitude: Rounds n to the nearest magnitude (defined by 10^order)For the order value, use positive numbers for decimal places, and negative numbers for approaching the nearest 10,100,1000 etc/roundm(355.67,-2) = 400
roundm(355.67,1) = 355.7
functionround, decimal places, nearest, magnitude
floor(n)6Floor: Rounds down to the nearest whole number floor(-6.7) = -7
floor(6.7) = 6
function
ceil(n)5Ceiling: Rounds up to the nearest whole numberceil(3.7) = 4
ceil(-3.7) = -3
function
ceiling(n)5Ceiling: Rounds up to the nearest whole numberUse ceil(n) as shortcutceil(3.7) = 4
ceil(-3.7) = -3
function
factorial(n)6Factorial: If n==4 for example, factorial(n) calculates 4*3*2*1Use math symbol ! As shortcutfactorial(4) = 24function
percentchange(x,y)7Percent change: increase % of y over xpercentchange(50,200)
= 300%
function
mod(n,base)7Modulus: Calculates the Floored modulus as defined by Knuth% will also perform a modulus operation if the appropriate option is ticked in the options window (for example 5%3 = 2). Also see fmod, tmod and emod.fmod(5, 3) = 2
fmod(5, -3) = -1
fmod(-5, 3) = 1
fmod(-5, -3) = -2
functionprogrammer
modulus(n,base)7Modulus: Calculates the Floored modulus as defined by Knuth% will also perform a modulus operation if the appropriate option is ticked in the options window (for example 5%3 = 2). Also see fmod, tmod and emod.fmod(5, 3) = 2
fmod(5, -3) = -1
fmod(-5, 3) = 1
fmod(-5, -3) = -2
functionprogrammer
tmod(n,base)7Truncated modulus: Calculates the common truncated modulusA commonly used modulus, but apparently less useful than the Floored or Euclidean modulustmod(5, 3) = 2
tmod(5, -3) = 2
tmod(-5, 3) = -2
tmod(-5, -3) = -2
functionprogrammer
fmod(n,base)7Floored modulus: Calculates the Floored modulus as defined by KnuthFloored modulus is supposed to be more mathematically useful than the truncated modulusfmod(5, 3) = 2
fmod(5, -3) = -1
fmod(-5, 3) = 1
fmod(-5, -3) = -2
functionprogrammer
emod(n,base)7Euclidian modulus: Calculates the Euclidean modulusEuclidean modulus is supposed to be more mathematically useful than the truncated or floored modulusemod(5, 3) = 2
emod(5, -3) = 2
emod(-5, 3) = 1
emod(-5, -3) = 1
functionprogrammer
min(n1, n2, ...)7Minimum: Finds the minimum of two or more given numbersmin(7, 90, 3, 50) = 3function
max(n1, n2, ...)7Maximum: Finds the maximum of two or more given numbersmax(7, 90, 3, 50) = 90function
average(n1, n2, ...)7Average: Finds the average of two or more given numbersaverage(5,6,10) = 7functionmean, middle
mean(n1, n2, ...)7Average: Finds the average of two or more given numbersmean(5,6,10) = 7function
median(n1, n2, ...)7Average: Finds the median of two or more given numbersmedian(5,6,10) = 6function
dist(x1,y1,x2,y2)5Distance2D: Finds the Euclidean 'ordinary' distance between two pointsdist(0,0, 10,10) = 14.142136function
dist3(a,b,c,x,y,z)4Distance3D: Finds the Euclidean 'ordinary' distance between two 3D pointsdist3(0,0,0, 1,1,1) = 1.73205function
norm(n, start, end)5Normalize: How far 'n' is through start to end, where 'through' means from 0-1A surprisingly useful function in a programming context. (n - start) / (end - start)norm(5, 4,8) = 0.25function
map(n, oldStart, oldEnd, newStart, newEnd)5Map: As 'Normalize', except normalizing isn't restricted from 0-1.A surprisingly useful function in a programming context and equal to: (newEnd - newStart) * (n - oldStart) / (oldEnd - oldStart) + newStart. norm5() was the old name for this function. Also look at "maplog", "maploglin", and "maplinlog" for variations on the map() function.map(5, 4,8, 10,20) = 12.5function
maplog(n, oldStart, oldEnd, newStart, newEnd)5Map log to log: As 'Map', except normalization takes place in log space. maplog(2, 1,4, 1,100) = 10function
maploglin(n, oldStart, oldEnd, newStart, newEnd)5Map log to Linear: As 'Map', except normalization takes place in log space for the input and linear space for output. maploglin(2, 1,4, 0,100) = 50function
maplinlog(n, oldStart, oldEnd, newStart, newEnd)5Map linear to log: As 'Map', except normalization takes place in linear space for the input and log space for output. maplinlog(5, 0,10, 1,100) = 10function
function
cdiv(p1, p2)4Chance divide: Divides normalized probabilities into specified new probabilityAn example of how this works would be to say: How many dice rolls would I need to have a 50% chance of at least one of the rolls being a six? And the function for that would be: cdiv(0.5, 1/6). The function used behind the scenes is: Math.log(1-x) / Math.log(1-y);cdiv(0.5, 1/6) = 3.801784function
hex2rgb(h)5Hex colour code triplet to RGBrgb2hex(192 , 191, 193 ) = #c0bfc1functionhtml, convert, color
rgb2hex(r,g,b)5RGB triplet to hex colour codehex2rgb(c0bfc1) = 192,191,193functionhtml, convert, color
rsin(n)6Radian sine: Trigonometric function, but using cycles, rather than degrees/radiansFrom OpalCalc 1.34 onwards, this function operates using radians instead of turnsrsin(0.5pi) = 1function
rcos(n)6Radian cosine: Trigonometric function, but using cycles, rather than degrees/radiansFrom OpalCalc 1.34 onwards, this function operates using radians instead of turnsrcos(0.5×2pi) = -1function
rasin(n)6Radian arcsine: Trigonometric function, but using cycles, rather than degrees/radiansFrom OpalCalc 1.34 onwards, this function operates using radians instead of turnsrasin(1) = 1.5707963function
racos(n)6Radian cosine: Trigonometric function, but using cycles, rather than degrees/radiansFrom OpalCalc 1.34 onwards, this function operates using radians instead of turnsracos(-1) = 3.14159function
rtan(n)6Radian tangent: Trigonometric function, but using cycles, rather than degrees/radiansFrom OpalCalc 1.34 onwards, this function operates using radians instead of turnsrtan(0.125pi) = 0.414214function
ratan(n)6Radian arctangent: Trigonometric function, but using cycles, rather than degrees/radiansFrom OpalCalc 1.34 onwards, this function operates using radians instead of turnsratan(1) = 0.78539816function
ratan2(x, y)6Radian arctangent 2: Trigonometric function, but using cycles, rather than degrees/radiansFrom OpalCalc 1.34 onwards, this function operates using radians instead of turnsratan2(1,1) = 0.78539816function
cos(n)6Cosine: Trigonometric function CosineAngle mode of this function can be set in the prefs under Symbols/syntaxfunction
sin(n)6Sine: Trigonometric function SineAngle mode of this function can be set in the prefs under Symbols/syntaxfunction
tan(n)6Tangent: Trigonometric function TangentAngle mode of this function can be set in the prefs under Symbols/syntaxfunction
acos(n)6Arccosine: Trigonometric function ArccosineAngle mode of this function can be set in the prefs under Symbols/syntaxfunction
asin(n)6Arcsine: Trigonometric function ArcsineAngle mode of this function can be set in the prefs under Symbols/syntaxfunction
atan(n)6Arctangent: Trigonometric function ArctangentAngle mode of this function can be set in the prefs under Symbols/syntaxfunction
atan2(x,y)6Arctangent2: Trigonometric function Arctangent2Angle mode of this function can be set in the prefs under Symbols/syntaxfunction
cosh(n)6Hyperbolic cosine: Trigonometric function Hyperbolic cosineAngle mode of this function must be set to radians in the prefs under Symbols/syntaxcosh(1) = 1.5430806
function
sinh(n)6Hyperbolic sine: Trigonometric function Hyperbolic sineAngle mode of this function must be set to radians in the prefs under Symbols/syntaxsinh(1) = 1.1752012
function
tanh(n)6Hyperbolic tangent: Trigonometric function Hyperbolic arccosineAngle mode of this function must be set to radians in the prefs under Symbols/syntaxtanh(1) = 0.76159416
function
acosh(n)6Hyperbolic arccosine: Trigonometric function Hyperbolic arccosineAngle mode of this function must be set to radians in the prefs under Symbols/syntaxacosh(2) = 1.3169579
function
asinh(n)6Hyperbolic arcsine: Trigonometric function Hyperbolic arcsineAngle mode of this function must be set to radians in the prefs under Symbols/syntaxasinh(1) = 0.88137359
function
atanh(n)6Hyperbolic arctangent: Trigonometric function Hyperbolic arctangentAngle mode of this function must be set to radians in the prefs under Symbols/syntaxatanh(0.5) = 0.54930614function
tsin(n)6Turn sine: Trigonometric function, but using cycles, rather than degrees/radianstsin(1÷8) = 0.70710678function
tcos(n)6Turn cosine: Trigonometric function, but using cycles, rather than degrees/radianstcos(1÷8) = 0.70710678function
tasin(n)6Turn arcsine: Trigonometric function, but using cycles, rather than degrees/radianstasin(1) = 0.25function
tacos(n)6Turn cosine: Trigonometric function, but using cycles, rather than degrees/radianstacos(0) = 0.25function
ttan(n)6Turn tangent: Trigonometric function, but using cycles, rather than degrees/radiansttan(0.125÷2) = 0.414214function
tatan(n)6Turn arctangent: Trigonometric function, but using cycles, rather than degrees/radianstatan(1) = 0.125function
tatan2(x, y)6Turn arctangent 2: Trigonometric function, but using cycles, rather than degrees/radianstatan2(1,1) = 0.125function
dcos(n)6Degree cosine: Trigonometric function Cosinedsin(45) = 0.70710678function
dsin(n)6Degree sine: Trigonometric function Sinedcos(45) = 0.70710678function
dasin(n)6Degree arcsine: Trigonometric function Arcsinedasin(1) = 90function
dacos(n)6Degree arccosine: Trigonometric function Arccosinedacos(0) = 90function
dtan(n) 6Degree tangent: Trigonometric function Tangentdtan(0.125*180) = 0.414214function
datan(n)6Degree arctangent: Trigonometric function Arctangentdatan(1) = 45function
datan2(x, y)6Degree arctangent2: Trigonometric function Arctangent2datan2(1,1) = 45function
around(a, b, accuracy)5Around: Returns true/false according to whether a is 'around' baround(4,4.3, 0.5) = True
around(4,4.6, 0.5) = False
function
pascal(row, index) 4Pascal: Returns number from Pascal's triangle according to row and horizontal indexpascal(10,2) = 45function
rmsquare()4Root mean square: Statistical measure of the magnitude of a varying quantityrmsquare(2,4,6) = 4.3204938functionquadratic mean
sigdig(n, digits)3Significant digits: Calculates n to 'digits' significant digitssigdig(456789,3) = 457,000function
geomean(n1, n2, ...)6Geometric mean: Geometric mean of two or more numbersgeomean(1,4,16,64) = 8function
gmean(n1, n2, ...)6Geometric mean: Geometric mean of two or more numbersgmean(1,4,16,64) = 8function
sum(n1, n2, ...)8Sum: A simple summation of two or more numberssum(1,2,3,4) = 10function
hmean(n1, n2, ...) 4Harmonic mean: Harmonic mean of two or more numbershmean(2,3) = 2.4function
variance(n1, n2, ...)4Variance (sample): Variance of two or more numbersThis sample type is more common than the population typevariance(10,20,30,40) = 166.66667function
pvariance(n1, n2, ...)4Variance (population): Variance of two or more numbersThis population type is less common than the sample typepvariance(10,20,30,40) = 125function
stdev(n1, n2, ...)5Standard deviation (sample): Standard deviation of two or more numbersThis 'sample' type is apparently more commonly used than the population typestdev(2,4,6) = 2function
pstdev(n1, n2, ...)5Standard deviation (population): Standard deviation of two or more numbersThis 'population' type is apparently less commonly used than the sample typepstdev(2,4,6) = 1.6329932function
madev(n1, n2, ...)4Mean absolute deviation: MAD of two or more numbersOften more useful than the standard deviation according to: http://www.leeds.ac.uk/educol/documents/00003759.htm (archive) and also https://www.edge.org/response-detail/25401 (controversy here)madev(2,4,6) = 1.333333functionmad
ginidev(n1, n2, ...)4Gini mean devitation: GMD of two or more numbersAlternative to standard deviationginidev(2,4,6) = 2.6666667function
ginidevb(n1, n2, ...)4Gini mean devitation B: GMD of two or more numbers (alternative)Like ginidev(), but comparison difference includes self as an errorginidevb(2,4,6) = 1.7777778function
gstdev(n1, n2, ...)3Geometric standard deviation: GSD of two or more numbersgstdev(2,4,6) = 1.5739735function
fibonacci(n)4Fibonacci: Returns number from fibonacci sequence at position nfibonacci(7) = 13function
imult(x,y)3Inverse multiply: Defined by 1 - (1-x)/y;imult(0.5,2) = 0.75
imult(0.5,4) = 0.875
imult(0.5,1.5) = 0.6666667
function
gcd(n1, n2, ...)5Greatest common divisor: GCD of two or more numbersgcd(24,20) = 4functionGCF, HCF, GCF, HCD, greatest common factor, highest common factor, highest common divisor
lcm(n1, n2, ...) 5Least common multiple: LCM of two or more numberslcm(24,20) = 120functionLCM, SCM, least common multiple, lowest common multiple, smallest common multiple
c2f() 7Celsius to Fahrenheit: Converts from Celsius to Fahrenheitc2f(20) = 68functiontemperature, thermometer, weather
f2c() 7Fahrenheit to Celsius: Converts from Fahrenheit to Celsiusf2c(68) = 20functiontemperature, thermometer, weather
rnd(n)7Random with max: Creates random floating number between zero and specified numberCaution: Changes every time the interface updatesrnd(100) = 42.613function
rnds(n)7Random with seed: Creates random floating number between zero and one according to specified seedrnds(235) = 0.866409896447294function
rndi(n)7Random integer with max: Creates random integer number between zero and specified numberCaution: Changes every time the interface updates. Also the max number will be one less than specified.rnds(10) = 7function
rndis(n)7Random integer with max and seed: Creates random integer number between zero and specified number according to specified seedCaution: Changes every time the interface updates. Also the max number will be one less than specified.rndis(623385,10) = 2function
iterlog(n,b) 2Iterated logarithmSee here for details: http://stackoverflow.com/a/30151203/848344iterlog(300000000,2) = 5function
combinations(e,s)5Combinations without duplicatesThis function gives the total number of combinations based on a given number of elements each of which can be set to a given state. For example, two elements which could be either A, B or C, would result in three combinations. The formula is: s! / (e! * (s-e)!)combinations(2,3) = 3
(e.g: AB, AC, BC)
function
combinationsr(e,s)5Combinations with duplicatesThis function gives the total number of combinations based on a given number of elements each of which can be set to a given state (duplicate states are allowed). For example, two elements which could be either A, B or C, would result in six combinations. The formula is: (s + e - 1)! / (e! Ă— (s-1)!)combinationsr(2,3) = 6
(e.g: AA, AB, AC, BB, BC, CC)
function
permutations(e,s)5Permutations without duplicatesThis function gives the total number of permutations based on a given number of elements each of which can be set to a given state. Unlike the combinations funtion, order DOES matter. For example, two elements which could be either A, B or C, would result in six permutations. The formula is: s! / (s-e)!permutations(2,3) = 6
(e.g: AB, AC, BA, BC, CA, CB)
function
permutationsr(e,s)5Permutations with duplicatesThis function gives the total number of permutations based on a given number of elements each of which can be set to a given state. Unlike the combinations function, the order DOES matter. For example, two elements which could be either A, B or C, would result in nine permutations. The formula is: s^epermutationsr(2,3) = 9
(e.g: AA, AB, AC, BA,
BB, BC, CA, CB, CC)
function
pi7Math Pi: Equal to apx. 3.14159265You can also use the Pi symbol as well as the word.pi = 3.1415927constantconstant, variable
tau7Math Tau: Equal to 2pi or apx. 6.2831853Preferable over Pi sometimes to simplify math. You can also use the symbol.tau = 6.2831853constantconstant, variable
k8thousand: Multiplies value by 1000k = 1000constantconstant, variable
million7million: Multiplies value by 1,000,000million = 1,000,000constantconstant, variable
billion7billion: Multiplies value by 1,000,000,000billion = 1,000,000,000constantconstant, variable
trillion7trillion: Multiplies value by 1,000,000,000,000trillion = 1,000,000,000,000constantconstant, variable
ee7Euler's number: Euler's number is equal to apx.: 2.71828ee = 2.7182818constantconstant, variable
phi7Phi number: Phi is the golden ratio 1.618034phi = 1.618034constantprogrammer
true5true: Denotes truetrue = Trueconstantprogrammer, special
false5false: Denotes falsefalse = Falseconstantprogrammer, special
time8Time: Convert to hour:min:sec formatUsed in conjunction with 'as' or 'in'. This overrides the 'default time unit' setting in the Options window.100 minutes as time = 01:40:00
1day + 2hour + 3minutes + 4seconds as time = 1.02:03:04
specialhourminsec, hour:min:sec
total8Sheet total: Represents the total of all previous values in the calculatorNB: The 'clear' keyword can be used to 'cut off' total as shown in the tutorial. Note that variable assignment lines or lines that use special words like 'total' as a variable are not included in a new total5
3
2
total = 10
specialsum
vtotal6Sheet total including variable assignments: Represents the total of all previous values in the calculatorYou would usually use 'total' instead of this.5
3
n = 2
total = 10
special
clear7Global variable reset: Clears values above this point from contributing to the totalAlthough variable assignments and other special words like 'total', 'subtotal', and 'count' are not taken into account when you want to calculate a new total, sometimes you don't want ANY numbers above a certain point to contribute. Using 'clear' solves this problem. Just be careful exactly where its positioned in the doc.5
3
2
total = 10
clear
1
2
total = 3
special
subtotal7Sheet subtotal: Like 'total', except only calculates up to the last subtotal/total. Note that variable assignment lines or lines that use special words like 'total' as a variable are not included in a new total.2
3
subtotal = 5
1
2
subtotal = 3
special
count7Sheet count: Counts the number of previous calculationsThe count excludes previous special keywords such as total or variable assignment lines3333
5555
count = 2
special
subcount7Sheet subcount: Like 'count', except only calculates up to the last subcount/countThe subcount excludes previous special keywords such as total or variable assignment lines3333
5555
count = 2
special
ans = 777
special
ansright6Previous answer's right-most tokenThis is an experimental feature that can be used in conjunction with time ranges that can make sheets clearer. See the home page for a good example of how to use it.@ 8:00:00 to 10:00:00
ansright = 10:00:00
specialtime
anscount7Counts the amount of numbers if your previous sum.5 + 60 + 7000
anscount = 3
special
'as' or 'in'9Convert between units or currencyOpalCalc allows you to convert measurements or currency (a list is given in the 'Units' submenu from the Pi button menu dropdown). You can use either 'as' or 'in'5m as cm = 500 cm
£5 + £5 in usd = \$16.06
4 hours as minutes = 240 minutes
specialconversion, translate, currency
rem6Calculate division sum with remainder in answerUse x/y and then add "rem" on the end (without the quotes). This is a special case operation and can't be used with other maths in the sum.7/3 rem       (= 2 rem 1)specialremainder integer divison divide
now8The current timeThis variable doesn't just represent the time at that point, but constantly updates as time passes. If you want it fixed, then press Ctrl+T or Ctrl+B instead. Also on top of "now", you can use "nowlocal" or "nowutc" to override the UTC on/off option in the options window.@ now
@ now + 1 hour
specialtime
today8The current day/dateThis variable doesn't just represent that day, but will constantly update as new days pass. If you want it fixed, then use Ctrl+D instead.@ todayspecialtime
yesterday7Yesterday's day/dateThis variable doesn't just represent that day, but will constantly update as new days pass. If you want it fixed, try pressing Ctrl+D instead and then type "- 1 day" without the quotes (don't forget the @ symbol at the line's beginning)..@ yesterdayspecialtime
tomorrow7Tomorrow's day/dateThis variable doesn't just represent that day, but will constantly update as new days pass. If you want it fixed, try pressing Ctrl+D and then type "+ 1 day" without the quotes (don't forget the @ symbol at the line's beginning).@ tomorrowspecialtime
BUTTON: Cut [Ctrl+X]10Cuts text to the clipboard...so you can reuse in OpalCalc or another program. Simply select some text, then hold down the Ctrl key and press X. Also, as a bonus, if nothing is selected, then the current/last sum is cut instead.button
BUTTON: Copy [Ctrl+C]10Copies text to the clipboard...so you can reuse in OpalCalc or another program. Simply select some text, then hold down the Ctrl key and press C. Also, as a bonus, if nothing is selected, then the current/last sum is copied instead. As yet another bonus, Alt+C copies the answer and Ctrl+Alt+C copies the sum AND answer.button
BUTTON: Paste [Ctrl+V]10Pastes text from the clipboard...so you can reuse in OpalCalc or another program. Simply hold down the Ctrl key and press V.button
BUTTON: Undo [F5]8Undo last operationbutton
BUTTON: Redo [F6]8Redo last operationbutton
BUTTON: Zoom out [F7]9Zooms out to fit more text in windowUse Ctrl + mouse wheel for even simpler shortcutbuttonmagnifying glass, small, large, font, text, resize
BUTTON: Zoom in [F8]9Zooms in to make text easier to readUse Ctrl + mouse wheel for even simpler shortcutbuttonmagnifying glass, small, large, font, text, resize
BUTTON: Minimize window [F9]8Sends window to back and highlights previous programbutton
BUTTON: Keep on top [F10]8Keep window on top of other programsbutton
BUTTON: Clone line [F11]8Inserts a copy of the current line just below (or copies previous line if current line is empty)button
BUTTON: Remove line [F12]9Clears and removes the current lineF12 is easy to remember as a line delete, as it's just above the Backspace key.button
MENU: Export worksheet...8Combines questions and answers to form one sheetFrom this new window, you can also save the sheet to a text file. This used to be called "Show all Q+A".menu
MENU: New window9Opens a new document so you can work on different sheets at the same time.This could previously also be achieved via Windows through Shift+Left left mouse button on the program's icon, though some of you may not have known thismenu
MENU: Edit: Copy sum to clipboard8Copies the current sum (or last sum if current is blank) to the clipboard if nothing's selected"Ctrl+C" means Hold down Ctrl and press Cmenu
MENU: Edit: Cut sum to clipboard8Cuts the current sum (or last sum if current is blank) to the clipboard if nothing's selected"Ctrl+X" means Hold down Ctrl and press Xmenu
MENU: Edit: Copy answer to clipboard9Copies the current answer (or last answer if current is blank) to the clipboard if nothing's selected"Ctrl+C" means Hold down Ctrl and press Cmenu
MENU: Edit: Copy sum and answer to clip7Copies the current sum and answer to the clipboard"Ctrl+Alt+C" means: Hold down Ctrl and Alt, and then press Cmenu
MENU: Edit: Open last session7Opens the document sheet when you last closed OpalCalcShift+F1 is the shortcut. You can get OpalCalc to do this automatically by ticking "Load last session on startup" in the Options window.menu
MENU: Edit: Zero orphan variables5Any variables you've created will have their values clearedThis is useful if you're repeatedly changing values for mulitple variables (save having to keep using backspace).menu
MENU: Edit: Bracket selected text5Places brackets around any text you've highlightedparenthesis, selectionmenu
MENU: Edit: Select all text8Selects all text, ready to copyUse Ctrl+A for keyboard shortcut. This is a standard in Windows for many programsmenu
MENU: Edit: Time: Insert date [Ctrl+D]7Inserts date (follows country format)Something similar to dd/mm/yyyy or a mix of thosemenu
MENU: Edit: Time: Insert time [Ctrl+T]7Inserts time (follows country format)24 hour format of local timemenu
MENU: Edit: Time: Insert custom format date/time [Ctrl+B]7Inserts date/time in the format you specified by the "Date/time format" submenumenu
MENU: Search7Find any text inside the documentUse the standard Ctrl+F shortcut to bring this toolbar up. Also the shortcuts to find 'next' and 'previous' are F3 and F2.menufind, filter
MENU: Prefs8Load or Save default preferences, or to a file for multiple setupsEverything from the window's position and colour to the most advanced options are all saved. If you don't want OpalCalc to save the preferences automatically when you exit the program, please deselect Prefs -> Auto save prefs on exit. You can also reset/restore back to default factory settings if you so wish, or if OpalCalc is displaying strange results.menutroubleshooting, problem, bug, help, settings, options, store, keep
MENU: Print8Print all sums along with answersSelect "Page setup" or "Page preview..." to set margins etc. If the output appears strange, try making the font smaller in the main window (F7/F8) since the lines could be wrapping over. Finally, you can set the spacing between the columns by selecting "More options...". You may also want to change to the "Equals format" from that new window.menu
CLEAR BUTTON: Clear document [F1]10Clears pageAlso clears any temporary variablesbutton
OPEN BUTTON: Open9Open a text file into OpalCalcmenu
SAVE BUTTON: Save9Save left side (input) calcs to a text file (overwrite existing one if a file is already open)
If you want to create a PDF from OpalCalc, there's a program called "CutePDF writer" which can help do exactly that when used in conjunction with OpalCalc's print feature.
OPTIONS BUTTON: Options window8Opens up the Options window so you can customize Opalcalc
HELP BUTTON: Example sums...9Allows you to see the kind of sums you can do in Opalcalcmenu
HELP BUTTON: Restore factory settings10Restores settings/options back to first-use defaultsIf you've been experimenting with the options, and things start to appear 'haywire', this handy option restores everything back to normal.menu
OPTION: General: PC symbols: * / instead of × ÷6Determines whether * or / should be used in place of × or ÷.× and ÷ are just cosmetic really unless you need to paste elsewhere.optionasterisk, multiply, times, divide, slash, stroke
OPTION: General: Use X key as shortcut to multiply9Determines whether the letter 'x' will be used as a multiplication symbol.To enable this, 'PC symbols' must not be ticked. If you want to use the real letter 'x', then with feature enabled, you'll need to 'comment out' that part of the line using ' or : or ;optionasterisk, multiply, times
OPTION: General: Use # key as shortcut to plus9Determines whether the keyboard button # will be used as an addition symbol.optionplus, add, shortcut
OPTION: General: Programmer syntax (for ^ and ! )7This makes ^ act as XOR instead of exponentiation and ! act as NOT instead of the factorial operatoroption
OPTION: General: Use modulus (not percent) for %7This makes % act as modulus instead of the usual percentage funtionality.option
OPTION: General: Convert square brackets7Determines whether [ or ] will convert to ( or )This is handy since [ or ] is easier to press than Shift+9 or 0 that is used on many keyboards.optionbrackets, parenthesis, curly
OPTION: General: Add spaces when using +, -, or =7Usually OpalCalc will insert a space between numbers and minus/plus/equals symbols. Unticking this prevents that.option
OPTION: General: Add spaces when using ÷ and ×7Usually OpalCalc will insert a space between numbers and multiplication or divide symbols. Unticking this prevents that.option
OPTION: General: Use built in special vars7Disable this tickbox if you want to use special variables such as 'radian', 'total', 'average' etc. for your own purposes.option
OPTION: General: Use built in constants and units7Disable this tickbox if you want to use variables such as 'metre', 'm', 'kg', 'k', 'half' etc. for your own purposes.option
OPTION: General: Case sensitive custom variables4Decide whether you want say, n and N to refer to the same variable or not.option
OPTION: General: Angle mode7Determines angle mode for trigonometry functions"Sin", "cos", and "tan" etc. will depend on the menu item selected here. You can override these functions by specifying the first letter of the angle mode before each function (e.g. dsin, dcos, and dtan for the [d]egree mode)optiontrigonometry, trig
OPTION: General: Notation7Select between different ways of representing numbers in the outputSelect 'Custom Set options' to open a window with an extensive set of number formatting options. Conveniently, you can change these, and the answers will update on the fly in the main window. If you want to save a custom notation set for later use, use 'Prefs -> Save prefs as...'optionscientific, engineering, financial, integer,
OPTION: General: Sheet cycles3The maximum number of times a sheet's calcs will run after each keypressThe max number of times OpalCalc should cycle through a sheet to try and resolve variables. Higher values will resolve deeply unresolved variables (a=b; b=c; c=10 means 'a' won't be known on the first or second cycle), but will make OpalCalc run slower.a=b
b=c
c=d
d=5
option
OPTION: General: Default output number base4Choose between any number base including binary, hexadecimal, octal, and base 12!OpalCalc can handle the decimal point too. Type in ` (backtick) in the below reference for more information on using other number bases.option
OPTION: Currency: Default output currency7Adjust the right hand column's default currency, no matter what you input'Auto' is the default, and means that the output currency is dependant on the first currency type in your sum (e.g.: \$4 + £4 would output in \$).option
OPTION: Currency: Dollar type7Adjust dollar type for the symbol '\$'When you use the symbol '\$', OpalCalc defaults to the US dollar. This can easily be adjusted from this menu.option
OPTION: Currency: Don't use web for currencies7Prevent OpalCalc from accessing the internet for currency informationIf this is turned on, OpalCalc will resort to accessing any existing currency information from disk.option
OPTION: Currency: See last currency update time7See update time of latest downloaded currency dataThis is supposed to be the time from the vendor, not necessarily the time that OpalCalc downloaded that data.option
OPTION: Currency: Update currencies now6Use this to get the latest conversion rates if OpalCalc has been open for daysoption
OPTION: Currency: Add/edit unsupported currencies6If your currency is not listed among the 90 supported, then select this option and follow the instructions in the given text file for manual usage.option
OPTION: Appearance: Change font [Ctrl+G]8Choose a font and style from a listDecent options include:
• Microsoft Sans Serif (default OpalCalc font, includes unicode set)
• Segoe UI, Arial Rounded MT, or Gill Sans MT (for a clear and 'simple' look)
• Franklin Gothic (for condensed letters, but wide numbers)
• Comic Sans (you know you love it really)
• Mangal (large line spacing)
• Fixedsys Excelsior or Lucida Console (for fixed width characters)
• Tahoma, Trebuchet MS, Verdana (each similar to Microsoft Sans Serif / Arial / Helvetica)
• optiontypeface, glyph, unicode, style, theme, skin, character, font
OPTION: Appearance: Show edit toolbar [Ctrl+F1]7Toggles the edit toolbar on/offoption
OPTION: Appearance: Show help toolbar [Ctrl+F2]6Toggles the help toolbar on/offoption
OPTION: Appearance: Show main toolbar [Ctrl+F4]6Toggles the main toolbar on/offBe careful with this one. Press F2 (for Options) or Ctrl+F4 to bring this back.option
OPTION: Appearance: Colour scheme [F4]8Swaps between colour schemesPress F4 in the main window as a shortcut. You can also adjust the saturation of each scheme.optionstyle, skin, theme
OPTION: Appearance: Colour saturation (text and GUI)5Allows you to set how rich the colours should be for the text and interface.The sliders allow negative numbers so you can reverse the colour to the other side of grey.optionstyle, skin, theme
OPTION: Time: Default time unit7For time spans (rather than time/dates), this submenu allows you to change the representation of the outputoption
OPTION: Time: Date/time format7For dates/times (rather than time spans), this submenu allows you to change the representation of the outputoption
OPTION: Time: Update less often for live times6Toggle between frequent (per second) and non-frequent (per minute) for live time updating.When you use keywords such as 'now' or 'today', the time will update every second by default (or when you press a key). However this option will update the time once a minute instead (less distracting!).option
OPTION: Time: Intepret input as UTC time6Input dates/times in UTC/GMT time format.Also see "Produce output in UTC time"optionGreenwich Mean Time, Coordinated Universal Time
OPTION: Time: Produce output in UTC time6Output dates/times in UTC/GMT format.Also see "Intepret input as UTC time"optionGreenwich Mean Time, Coordinated Universal Time
OPTION: Word wrap8Allows you to wrap text or alternatively contain each sum on a single line.option
OPTION: Load last session on startup7On startup of OpalCalc, the last document session will automatically be opened (including unsaved documents).option
OPTION: Log calc sheets to disk upon close.7Appends all sums inside the document to the "calc-log.txt" file.Never lose a calculation again!option
OPTION: Allow only one OpalCalc instance6If ticked, prevents multiple instances of OpalCalc opening up.This can allow you to bind OpalCalc to the Calculator button on the keyboard etc.option
OPTION: Window always on top8Keep the OpalCalc window above the windows you may have open (press F10 to toggle).option
OPTION: Ask to save on quit7When you close OpalCalc, this determines whether you are asked if you want to save the document.Selecting "Never" will mean OpalCalc will close - no questions asked. "Always" does the reverse (except for docs that are already saved). The default "Over 200 chars + files" means that when closing Opalcalc, you'll be asked if you want to save unsaved docs with more than 200 characters, or files which have been adjusted since the last save.option
OPTION: Hide/show Opalcalc hotkey8This enabled or disables the global hotkey which sends OpalCalc to the tray and back again.Use this in conjunction with the Hotkey field just below which is set to Ctrl+Comma by default. To change this, simply click in the field and enter the shortcut you wish.optionKeyboard shortcut
OPTION: Open prog path / Open user path5These buttons open the location of the program or user path where the preference/user files are saved.option
PI MENU: Open user defined functions6Opens text file containing user defined user functionsMost of the time, you can create functions directly in OpalCalc, but if you're handy with Javascript, you might want to see the raw code. Further instructions in the text file given when you select this menu item.menu
PI MENU: Open user defined variables5Opens text file containing user defined user variablesYou can create permanent variables directly in OpalCalc (using uppercase, like N=10), but you can also create or view them here.menu
PI MENU: Open user defined units6Opens text file containing user defined user unitsIf you want to create your own units, please select this menu item, and follow the instructions once the text file has opened.menu