Trouble? If you don't see the calculator above this line within a few seconds after all of the files are loaded, make sure your browser supports Java and that Java is enabled (e.g., in Explorer, make sure Tools | Internet Options | Advanced | Enable Java is checked). If you are using CoCalc from files on your computer, make sure CoCalc.class is in the same directory as CoCalc.html.

If you don't have Java installed on your computer, you can download it for free from http://www.java.com. It is a reasonably big download, but a simple installation.

After reading this documentation, you can shrink the window so that only the calculator is visible.

CoCalc RPN Scientific Calculator

Copyright 1996-2004 CoHort Software (www.cohort.com). Version 1.05. Released 2003-3-11.

Table of Contents:

What is CoCalc?

CoCalc is an RPN scientific calculator from CoHort Software. In addition to the standard features for scientists, CoCalc includes several features for computer programmers (Hex and Binary notation, and some integer and boolean math functions). CoCalc has greater precision and greater range than most calculators. Also, this calculator will never be lost under a pile of papers on your desk; it won't ever need new batteries; and the buttons will never break.

What is CoCalc2?

CoCalc2 is a version of CoCalc with text that is much larger. Otherwise, it is identical.

CoCalc Is Free

Yes. CoCalc is freeware. You are welcome to obtain a copy of the program and use it for free. (However, we retain the copyright and ownership of CoCalc and you are forbidden from reselling or altering CoCalc.) CoCalc was created by CoHort Software, which makes graphics and statistics software for scientists and engineers. Since CoCalc is a small program, we are just giving it away. Please contact CoHort Software if you have any questions, suggestions, or comments about CoCalc.

"Can I install CoCalc on my computer?" Yes, in fact, we prefer that you install it on your computer instead of using it from the cohort web site.

For regular CoCalc:

  1. Download (right click or Apple click) http://www.cohort.com/CoCalc.html and choose to save the file somewhere on your hard drive.
  2. Download (right click or Apple click) http://www.cohort.com/CoCalc.class and choose to save the file in the same directory as CoCalc.html.
  3. Use your browser to view your copy of the calculator (CoCalc.html) even when you aren't connected to the internet. Consider adding a bookmark to your copy of CoCalc.html.

For CoCalc2 (the large text version):

  1. Download (right click) http://www.cohort.com/CoCalc2.html and choose to save the file somewhere on your hard drive.
  2. Download (right click) http://www.cohort.com/CoCalc2.class and choose to save the file in the same directory as CoCalc2.html.
  3. Use your browser to view your copy of the calculator (CoCalc2.html) even when you aren't connected to the internet. Consider adding a bookmark to your copy of CoCalc2.html.

"Can I put CoCalc on my web page?" Yes, if you:

  1. Credit CoHort Software and include a link to the CoHort Software home page. For example, you might include a paragraph like:
    Here is a free RPN scientific calculator available as a Java applet. CoCalc is free for personal use (but please do not alter or resell it). Download these files ( http://www.cohort.com/CoCalc.html and http://www.cohort.com/CoCalc.class ) and use your browser to view your copy of the calculator (CoCalc.html) even when you aren't connected to the internet.

    There is also a large text version of CoCalc, called CoCalc2. Download these files ( http://www.cohort.com/CoCalc2.html and http://www.cohort.com/CoCalc2.class ) and use your browser to view your copy of the calculator (CoCalc2.html) even when you aren't connected to the internet.

    Please change the http references to the CoCalc files on your server.
  2. Distribute the files for free and without making any changes to them.
  3. Send us an email message with your web site address (so we can see the reference) and your email address (so we can notify you of updates). We won't use this information for any other purpose.

Disclaimer: THIS CODE IS PROVIDED "AS IS", AND COMES WITHOUT ANY WARRANTY, EXPRESSED OR IMPLIED; WITHOUT EVEN THE IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. COHORT SOFTWARE SHALL NOT BE LIABLE FOR ANY DAMAGES, WHETHER DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL ARISING FROM THE USE OF THE SOFTWARE OR FROM THE INABILITY TO USE THE SOFTWARE OR FROM A FAILURE OF THE SOFTWARE TO OPERATE IN A MANNER DESIRED BY THE USER.

Return to the calculator.

Other Software:

CoHort Software develops graphics and statistics software for scientists and engineers. CoCalc is currently our only freeware program. Our other programs are: For further information, please contact us:
web site: www.cohort.com
email: info@cohort.com
CoHort Software, 798 Lighthouse Ave, PMB 320, Monterey, CA 93940, USA.

Our web site will always have the latest version of CoCalc.

Return to the calculator.

Source Code

CoCalc was written in Java. The source code is currently not available (sorry).

Return to the calculator.

Support

We welcome your comments and suggestions for improvements. If you find a bug please let us know. If you can't figure out how some feature works, please read the documentation below. If you still can't figure it out, contact us. The preferred method of communication is email (especially for people outside of North America), but phone, fax, and mail are okay (see the numbers and addresses above).

Upgrades: If you want to be put on an email mailing list to be notified when there is a new version of CoCalc, send email to info@cohort.com with the words "subscribe CoCalc" plus your email address on one line in the body of the message.

Return to the calculator.

History

1.00 released 7/23/96
1.01 released 11/18/96 - Fixed y^x (which acted like x^y).
1.02 released 8/27/97 -
Added support for keystrokes (which may not work with Java 1.1 and higher).
Fixed the button-down line draw error (which may occur with Java 1.1 and higher).
1.03 released 2000-1-21 - Added CoCalc2 (a large text version).
1.04 released 2000-9-19 - small documentation changes.
1.05 released 2003-3-11 - added support for '*', and ',' keys (aliases for 'x' and '.'). We couldn't add access to the clipboard because, for security reasons, applets can't get access to the clipboard.

Return to the calculator.

Introduction to Using CoCalc

CoCalc is a Reverse-Polish-Notation (RPN) scientific calculator. RPN calculators were popularized by Hewlett-Packard's great calculators. (If you buy a real calculator, get one from HP: they are well-designed, well-built, and reasonably priced. You can even visit the un-official HP calculator museum.)

On ordinary, non-RPN calculators, you do calculations by pressing buttons in the order that you would write an equation on paper (e.g., 5 - 2 = ). On RPN calculators, you enter the numbers and and then do something to them (e.g., 5 Enter 2 - ). You will note that RPN calculators don't have an = button or parentheses buttons, but they do have an Enter button.

If you aren't used to it, RPN seems odd at first. But when you get used to it and use it for non-trivial calculations, you will see that it is a wonderful system.

Return to the calculator.

Entering Numbers

For simple numbers, just press the appropriate buttons. For example, to enter 45.68, press: 4 5 . 6 8.

To enter a number with an exponent: after entering the mantissa of the number, press eex, and then enter the exponent. For example, to enter 4.56*10^5, press 4 . 5 6 eex 5. The display will show 4.56e5, which is the program's notation the numbers with exponents.

To make a number negative, type the number and then press chs (change sign). For example, to enter -4.56, press 4 . 5 6 chs. You can press chs repeatedly to add/remove the minus sign.

To make an exponent negative, press chs (change sign) after you have entered the exponent. For example, to enter 4.56*10^-5, press 4 . 5 6 eex 5 chs. The display will show 4.56e-5, which is the program's notation the numbers with exponents.

For many of the buttons, you can also type the similarly named keys. This works for the following keys: 0 1 2 3 4 5 6 7 8 9 a A b B c C d D e E f F ^ ! % . / x - + Enter backspace. The buttons that they correspond to should be obvious. Also supported are ',' (an alias for '.') and '*' (an alias for 'x'). Warning: note that '-' corresponds to the subtraction button ('-'); to change the sign of a number, you must use the 'chs' button.

Return to the calculator.

The Stack

The stack consists of 4 registers (slots which hold numbers), which are named: x, y, z, and t. When you enter a number, it is constructed in the x register.

When you have finished entering a number, you can do something to the number (e.g., press a button that does something to the value in the x register, like 10^x), or you can enter another number (press Enter and then start entering the next number.

Many buttons are commands that use the values in the x and y registers, e.g., +. When you use these, the result is placed in x, and the values in the z and t registers are move down: y= previous z, z= previous t. The t register is not changed.

There are 3 important keys for manipulating the numbers in the stack:

Automatic stack lift: After you use a command (e.g., ln or +), you can immediately enter another number; you don't need to press Enter to lift all of the values in the stack. After a command, if you press a digit, CoCalc will automatically lift the stack (as if you had pressed Enter).

Return to the calculator.

Operations

The basic approach to using CoCalc is: enter numbers into the registers (for example, press 2 Enter 3) and do things to them (press +). This is clearly not the same as entering an equation, but with a little practice it will become easier. Sometimes, you will see that there are two general approaches: 1) enter the numbers in the order they occur in the equation, using operators when the proper values are in the proper registers, and 2) start with the part of the equation that is within parentheses. These techniques are illustrated below.

Here are some simple equations and the buttons you need to press to do the calculation in CoCalc:

Problem: square root(9)=
Solution: press 9 x^0.5

Problem: 8/5=
Solution: press 8 Enter 5 /

Problem: 4 + (5*6) =
Solution 1) Press: 4 Enter 5 Enter 6 * +.
Solution 2) Press: 5 Enter 6 * 4 +. Note that you don't have to press Enter before typing 4; the stack is automatically lifted when you start typing a number after doing an operation.

Problem: 3*sin(1.5degrees)=
Solution 0) For either method, press Deg so the calculations will be done in degree mode.
Solution 1) Press: 3 Enter 1.5 sin *.
Solution 2) Press: 1.5 sin 3 *.

Problem: (16/5.6 + .5) / (pi*.8^2 + 4)
Solution: press 16 Enter 5.6 / .5 + pi Enter .8 x^2 * 4 + /

For more complicated equations or if you repeatedly use a constant, you may want to store values in a storage register.
Problem: Convert several length measurements (in inches) into centimeters.
Solution: Press 2.54 Store 0, then repeatedly press (a number) Recall 0 *

Return to the calculator.

Degrees vs. Radians

There are two units commonly used to measure angles: degrees and radians. A complete circle spans 360 degrees. A complete circle spans 2*pi radians. Sometimes it is easier to work in degrees; sometimes in radians. CoCalc can work with either.

The Deg and Rad radio buttons let you choose which mode will be used for subsequent trigonometric operations (sin, cos, tan, asin, acos, atan, ->Rec, ->Pol).

The ->Deg and ->Rad buttons let you convert an angle value in the x register from radians to degrees, or from degrees to radians, respectively.

Return to the calculator.

Display Options

Numbers can be displayed in different ways. The Fix, Sci, and Eng options all display numbers in base 10, but with slightly different ways of determining how many digits will be shown and how the exponent will be shown. The Hex and Bin options display rounded values in base 16 and base 2 respectively.

For all of these options, the numbers stored in the registers are not changed; the numbers are just displayed in different ways.

Fix - This format always shows a fixed number of digits to the right of the decimal place. To select the Fix display mode and specify the number of digits to the right of the decimal point, press Fix and then the desired number of digits, 0 - F. For example, 98765.12345 appears as 98765.123 if you use Fix 3. The last digit is rounded. If the number is too big or too small, scientific notation will be used.

Sci - Scientific notation always displays the number with one digit to the left of the decimal place, some specified number of digits to the right, and an exponent. To select the Sci display mode and specify the number of digits to the right of the decimal point, press Sci and then the desired number of digits, 0 - F. For example, 98765.12345 appears as 9.877e+004 if you use Sci 3. The last digit is rounded.

Eng - Engineering notation is similar to scientific notation, except that the exponent is constrained to be a multiple of 3. To select the Eng display mode and specify the number of digits to the right of the decimal point, press Eng and then the desired number of digits, 0 - F. For example, 98765.12345 appears as 98.765e+003 if you use Sci 3. The last digit is rounded. [HP calculator purists: no, this is not exactly the way HP does it. But this way makes the decimal points line up nicely.]

Hex - The Hex option displays the numbers in the registers by displaying rounded values in base 16. Hexadecimal, as base 16 is called, is widely used by computer programmers. When you are typing in numbers in this mode, you can use digits 0 - 9 and additional hex digits (A, B, C, D, E, and F) which stand for the base 10 numbers: 10, 11, 12, 13, 14, and 15, respectively. Because the calculator only works with integer hexadecimal numbers, you can't use the . or eex keys in Hex mode. Negative numbers are displayed with a '-' sign, which avoids a problem: there are two common ways to store negative numbers in Hex notation (two's complement and one's complement) and the number of digits is different for 16, 32, and 64 bit numbers. To select the Hex display mode, press Hex.

Bin - The Bin option displays the numbers in the registers by displaying rounded values in base 2. Binary, as base 2 is called, is widely used by computer programmers. When you are typing in numbers in this mode, you can only use digits 0 and 1. Because the calculator only works with integer binary numbers, you can't use the . or eex keys in Bin mode. Negative numbers are displayed with a '-' sign, which avoids a problem: there are two common ways to store negative numbers in Bin notation (two's complement and one's complement) and the number of digits is different for 16, 32, and 64 bit numbers. Since binary notation is not very dense, you will get an error message if a number is too long to display. To select the Bin display mode, press Bin.

Return to the calculator.

Storage Registers

There are 16 registers (slots) into which you can store, and later retrieve, numbers.

To store the current x value, press store and the number of the register into which you want to store it (0 - F), e.g., store 4.

To recall a stored number and put it in x (as if you typed it in), press recall and the number of the register from which you are getting it (0 - F), e.g., recall 4.

You can set all of the storage registers to 0 by pressing clrReg.

Registers 0 - 5 are used by the statistics procedures to hold various sums. So, before using the statistics procedures, use clrReg. Until you are done with statistics don't store anything in registers 0 - 5.

Return to the calculator.

Statistics

CoCalc can do calculate simple correlation and linear regression statistics. To do so:
  1. Initialize the statistics system by pressing clrReg. Storage registers 0 - 5 are used by the statistics procedures to hold various sums. So, while using the statistics procedures, don't store anything new in registers 0 - 5.
  2. For each x,y pair of numbers, type the y value, press Enter, type the x value, and press Sig+. When you press Sig+, the program increments the storage registers (s0=s0+1, s1=s1+x, s2=s2+x^2, s3=s3+y, s4=s4+y^2, s5=s5+xy,) and displays the s0 value in x. These values will be used to calculate various statistics.
  3. When you are done entering the data, press any of the statistics keys:
If you make a mistake or wish to remove an x,y pair from the statistics, you can enter the x,y values and press Sig-.

All of the discussion above presumes you have x,y pairs. However, most of the statistics procedures (Sig+, Sig-, mean, S.D.) can be used if you just have x values.

Return to the calculator.

Precision and Errors

Return to the calculator.

Alphabetic List of Buttons:

.
While you are typing in a number, this appends '.' to the number.
%
Set x=x*y/100, y=y, z=z, t=t. Note that the y, z, and t registers are unchanged. For example, to calculate 15% of $30, press 30 Enter 15 %.
->Deg
Change x from Radians to Degrees: Sets x= x / 2pi * 360. This assumes that the original x value is an angle in Radians or Degrees, depending on the current Rad or Deg setting. See Degrees vs. Radians.
->Pol
Converts from rectangular coordinates(x,y) to Polar coordinates (x=radius, y=theta): Set x=sqrt(x^2+y^2), y=arcTan2(y,x), z=z, t=t. The y result is an angle in Radians or Degrees, depending on the current Rad or Deg setting. See Degrees vs. Radians.
->Rad
Change x from Degrees to Radians: Sets x= x * 360 / 2pi. See Degrees vs. Radians.
->Rec
Converts from polar coordinates (x=radius, y=theta) to Rectangular coordinates: set x=x*cos(y), y=x*sin(y), z=z, t=t. This assumes that the original y value is an angle in Radians or Degrees, depending on the current Rad or Deg setting. See Degrees vs. Radians.
/
Set x=x/y, y=z, z=t, t=t.
x
(Multiply) Set x=x*y, y=z, z=t, t=t.
-
Set x=x-y, y=z, z=t, t=t.
+
Set x=x+y, y=z, z=t, t=t.
<-
When you are typing in a number, this backspaces. It removes the rightmost character in the number (which is usually the last digit entered).
>>
Set x=round(y) shiftRight round(x), y=z, z=t, t=t. Shifting right is like doing an integer division by 2, x times. For example, 16 Enter 2 >> returns 4.
<<
Set x=round(y) shiftLeft round(x), y=z, z=t, t=t. Shifting left is like doing an integer multiplication by 2, x times. For example, 4 Enter 2 << returns 16.
0
While you are typing in a number, this appends '0' to the number.
1
While you are typing in a number, this appends '1' to the number.
1/x
Set x=1/x, y=y, z=z, t=t.
10^x
Set x=10 to the x. Also called common antilog.
2
While you are typing in a number, this appends '2' to the number.
3
While you are typing in a number, this appends '3' to the number.
4
While you are typing in a number, this appends '4' to the number.
5
While you are typing in a number, this appends '5' to the number.
6
While you are typing in a number, this appends '6' to the number.
7
While you are typing in a number, this appends '7' to the number.
8
While you are typing in a number, this appends '8' to the number.
9
While you are typing in a number, this appends '9' to the number.
A
While you are typing in a number in Hex mode, this appends 'A' to the number.
acos
Set x=arccos(x), y=y, z=z, t=t. The result is an angle in Radians or Degrees, depending on the current Rad or Deg setting. See Degrees vs. Radians.
and
Set x=round(y) and round(x), y=z, z=t, t=t. and compares the two numbers bit by bit. If the both bits are 1's, the resulting number has a 1 for that bit.
asin
Set x=arcsin(x), y=y, z=z, t=t. The result is an angle in Radians or Degrees, depending on the current Rad or Deg setting. See Degrees vs. Radians.
atan
Set x=arctan(x), y=y, z=z, t=t. The result is an angle in Radians or Degrees, depending on the current Rad or Deg setting. See Degrees vs. Radians.
B
While you are typing in a number in Hex mode, this appends 'B' to the number.
Bin
Display rounded numbers in binary format. See Display Options.
C
While you are typing in a number in Hex mode, this append 'C' to the number.
chs
Change the sign of x (or its exponent). See Entering Numbers.
clrReg
Clears the storage registers (0-F). Do it before doing Statistics. See Statistics.
clx
clear x: Set x=0, y=y, z=z, t=t.
CoCalc
Refresh the screen, and show some information about CoCalc, including the version number.
cos
Set x=cos(x), y=y, z=z, t=t. This assumes that the original x value is an angle in Radians or Degrees, depending on the current Rad or Deg setting. See Degrees vs. Radians.
D
While you are typing in a number in Hex mode, this appends 'D' to the number.
Deg
Trigonometric functions will be done in degrees. See Degrees vs. Radians.
div
Set x=round(y) integerDivide round(x), y=z, z=t, t=t. Div is the result of an integer division. See Mod. For example, 7 Enter 3 div returns 2.
E
While you are typing in a number in Hex mode, this appends 'E' to the number.
e^x
Set x=e to the x. Also called natural antilog. e is a constant approximately equal to 2.71828183.
eex
If in Fix/Sci/Eng modes, enter an exponent for x. See Entering Numbers.
Eng
Display numbers in engineering notation (with 0 - F digits). See Display Options.
Enter
Set x=x. y=x, z=y, t=z. See The Stack.
F
While you are typing in a number in Hex mode, this appends 'E' to the number in x.
Fix
Display a fixed number of decimal digits (0 - F). See Display Options.
frac
Set x=the fractional part of x, y=y, z=z, t=t.
Help
For a description of a button, press Help then press another button.
Hex
Display rounded numbers in hexadecimal format. See Display Options.
int
Set x=the integer part of x, y=y, z=z, t=t.
L.R.
Linear Regression: Sets x=intercept, y=slope, z=z, t=t. See Statistics.
last x
Set x=last x, y=x, z=y, t=z. The 'last x' is saved when you do an operation (e.g., ln, +) so you can recover the x value that existed before the operation.
ln
Set x=the natural log (base e) of x.
log
Set x=the natural log (base 10) of x.
mean
Sets x=mean of x's, y=mean of y's, z=z, t=t. See Statistics.
mod
Set x=round(y) modulus round(x), y=z, z=t, t=t. Modulus is the remainder of an integer division. See Div. For example, 7 Enter 3 mod returns 1.
n!
Set x=factorial(round(x)), e.g., 4!=1*2*3*4.
not
Set x=64bit 2's complement of round(x), y=y, z=z, t=t.
or
Set x=round(y) or round(x), y=z, z=t, t=t. or compares the two numbers bit by bit. If either of the bits is a 1, the resulting number has a 1 for that bit.
pi
Set x=3.14159265359, y=x, z=y, t=z.
Rad
Trigonometric functions will be done in radians. See Degrees vs. Radians.
recall
Recall x from a stored value (slots 0 - F). For example, to recall the value in slot 5 and put it in x, press recall 5. See Storage Registers.
roll Dn
roll down: Sets x=y, y=z, z=t, t=x. See The Stack.
S.D.
Sets x=standard deviation of the x's, y=standard deviation of the y's, z=z, t=t. See Statistics.
Sci
Display numbers in scientific notation (with 0 - F digits). See Display Options.
Sig-
Set storage registers: s0=s0-1, s1=s1-x, s2=s2-x^2, s3=s3-y, s4=s4-y^2, s5=s5-xy; x=s0. See Statistics.
Sig+
Set storage registers: s0=s0+1, s1=s1+x, s2=s2+x^2, s3=s3+y, s4=s4+y^2, s5=s5+xy; x=s0. See Statistics.
sin
Set x=sin(x), y=y, z=z, t=t. This assumes that the original x value is an angle in Radians or Degrees, depending on the current Rad or Deg setting. See Degrees vs. Radians.
store
Store x in a slot (0 - F). For example, to store the x value in slot 5, press store 5. See Storage Registers.
tan
Set x=tan(x), y=y, z=z, t=t. This assumes that the original x value is an angle in Radians or Degrees, depending on the current Rad or Deg setting. See Degrees vs. Radians.
x^0.5
Set x=square root of x, y=y, z=z, t=t.
x<->y
Swap the x and y register values, z=z, t=t. See The Stack.
x^2
Set x=x^2, y=y, z=z, t=t.
x^,r
Given a y value in the x register, this sets x=expected x, y=correlation coefficient (r), z=z, t=t. See Statistics.
xor
Set x=round(y) xor round(x), y=z, z=t, t=t. xor compares the two numbers bit by bit. If one bit is 0 and the other is 1, the resulting number has a 1 for that bit.
y^x
Set x=y^x, y=z, z=t, t=t.
y^,r
Given a x value in the x register, this sets x=expected y, y=correlation coefficient (r), z=z, t=t. See Statistics.

Return to the calculator.

This is the end of the CoCalc documentation.