# Halcyon Calc - Working With Real Numbers

Halcyon Calc, like most calculators, is great for manipulating real numbers. This document will describe how to work with real numbers in the following sections:

For the purposes of this document, the assumption is that the radix character is a period (see the RDX, operation for more information), thus making the comma character the separator. If you have the calculator configured differently, swap the use of the period and comma wherever they occur.

# Entering Real Numbers:

There are a few different formats which the calculator understands which you can use in order to enter a real number:

1. If the number is zero, you can just hit the "0" button followed by "Enter"
2. If the number is a simple positive integer, you can just hit the buttons for the digits in the number. Start with the left-most digit and enter the numbers as they appear. For example, to enter the number 1230, hit the buttons "1", "2", "3", "0" and finally "Enter".
3. If the number is positive but has a fractional part, you can hit the buttons for the non-fractional part of the number, then the period followed by the fractional digits. Again, enter the digits left to right. For example, to enter the number 12.3, hit the buttons "1", "2", ".", "3" and finally "Enter"
4. If the number is positive but less than one, like 0.123 for example, you can enter that as ".", "1", "2", "3" and finally "Enter". You could also hit the "0" button first but it isn't required.
5. If the number is a negative integer, you must use the "CHS" button which stands for "CHange Sign". Note that if you do not have anything on the command line yet, pressing "CHS" will affect the item at the top of the stack. Specifically, it executes the NEG operation on the item from the top of the stack.

But if you are entering a number, it will reverse the sign of that number. So, to enter the number -1230, hit the buttons "1", "2", "3", "0", "CHS" and finally "Enter". In fact, you can press "CHS" any time after you hit the "1" button. It will change the sign of the number and you can continue adding digits on the command line after that. Or, if you forget to the press "CHS" and complete entering the number as a positive integer, you can press the "CHS" button after to change its sign after pushing it onto the stack.

If you press "CHS" a second time on a number on the command line, it will reverse the negative sign so the number is positive again. So, it is easy to fix if you make a mistake.

6. If the number is a negative number with a fractional part, you can enter the number as a positive number with a fractional part and use the "CHS" button to make it negative any time after starting entering the number. Similarly for a negative number with only a fractional part.
7. If the number is very large, it may be easiest to represent it in exponential or scientific notation. For example, if you want to enter the number 1.23 x 1030, you would hit the buttons "1", ".", "2", "3", "EEX", "3", "0" and finally "Enter". The "EEX" button is used to enter a number is exponential notation. When you press it, an "E" character will be be added to the command line which is short hand for "times ten to the power of...". So, pressing those buttons will result in a command line which looks like "1.23E30".

Note that you can actually use the "E" button also from the left page of buttons instead of the "EEX" button. The command line does not distinguish between an "E" added by the "E" button or the "EEX" button. However, the "EEX" button is more convenient because it is on the same page as the digits themselves.

Also, the number does not need to have a decimal point in it. You could enter "123E28" which actually ends up being the same number (try it if you like).

8. If the number is a very large negative number, again you can use scientific notation. In this case, you should press the "CHS" button after entering the first digit but before pressing "EEX". If you forget to press "CHS" before pressing "EEX", you can always press it after pushing the number on the stack.
9. If the number is very small, you can also use scientific notation. In this case, the exponent will be a negative number. If you want to enter the number 1.23 x 10-30, you would hit the buttons "1", ".", "2", "3", "EEX", "3", "0", "CHS" and finally "Enter". Note that the "CHS" button operates on the exponent and not the number itself in this case. You can press "CHS" any time after hitting the "EEX" button. If you forget to press the "CHS" button before entering the number, you will need to "■Edit" the number again and apply the "CHS" to the exponent.
10. If the number is a very small negative number, like -1.23 x 10-30, you need to press "CHS" twice. You could enter this number by pressing "1", ".", "2", "3", "CHS", "EEX", "3", "0", "CHS" and finally "Enter". The first "CHS" makes the number itself negative while the second one makes the exponent negative. As before, you can press the first "CHS" any time after hitting the first digit and before pressing "EEX" while the second one must happen after pressing "EEX".

# Formatting Real Numbers:

Just like there are multiple ways to enter real numbers, you can display them on the calculator in multiple formats. These formats are global modes which means that all numbers displayed on the calculator will appear in a single format. If you change to a different format, all numbers displayed on the stack will automatically change and reflect the new format.

With any one format, not all digits will be displayed. In some formats, you can control exactly how many digits are shown. However, even though digits might not be shown they are still valid and used in calculations. You can round numbers to only the digits shown by using the RND operation if that is what you would like to do.

All of the buttons for setting the number format mode can be found in the Mode Menu which you can see by pressing the "■Mode" button. On that menu, you are able to chose between the following formats:

• Standard - Select this by hitting the STD button from the Mode menu. In this mode, numbers are displayed with up to 12 digits of accuracy. Exponential mode will not be used unless necessary. See the documentation for STD for more details.
• Fixed - In fixed mode, you can control the number of digits shown to the right of the decimal point. First, enter the number of digits you want used in fixed mode and then press the FIX button from the Mode menu. If you specify 3, then the number 50 will be displayed as "50.000". Zeroes will be added to the right of the decimal place as required. Just like in standard mode, exponential notation will be used when necessary. In exponential mode, the number of digits specified controls the display also. So, if the calculator is still in fixed mode with 3 as its number of digits, the number 5 x 1020 will be shown as "5.000E20".
• Scientific - Just like fixed mode, scientific mode expects a number which represents the number of digits to show to the right of the decimal point. In this case, exponential format will always be used, unlike in standard and fixed mode. Enter the number of digits you want displayed to the right of the decimal place and press the SCI button from the Mode menu. If the number 5 is show in scientific notation with 3 decimal place digits, the calculator will display "5.000E0".
• Engineering - Engineering mode also always uses exponential notation but in this case, the exponent is always evenly divisible by 3. Like fixed and scientific modes, engineering mode takes a number which represents how many digits to show. In this case, the number of digits shown is the number specified plus one. Those digits might be to the left or to the right of the decimal place. Enter the number of digits you want displayed minus one and press the ENG button from the Mode menu. For example, if the number 12300 is shown in engineering notation with 3 set as the number of digits, the number will appear as 12.30E3. The exponent is evenly divisible by three and four digits are shown in total.

# Special Real Numbers:

There are two special real numbers which are built into the calculator. They are π (pi) and e. The calculator knows their value and gives you a shortcut which you can use to enter them.

In the case of pi, you can press the "■π" button on the right page of buttons, followed by "Enter". You will see 'π' at the top of the stack. You can then operate on that value like you would any other real number, but instead of giving you a result, the calculator will build an "expression" (see the Working With Expressions guide for more information). That means if you add 1 to 'π' on the stack, you will see 'π+1'. At any time, you can press the "■→Num" button to convert that expression into a number.

Similarly for the number e. To enter it, press the "e" button (make sure you are in lower case mode and if not, press the "LC" button first). You will see 'e' at the top of the stack. Again, you can use the "■→Num" button to covert that to a number at any time.

Those are the only two real number constants built into the calculator but you can define your own. Refer to the Working With Symbols guide for more information.

# Limitations And Accuracy:

Real numbers in the calculator are stored in double precision floating point format. For people unfamiliar with what that means, it implies limits to how accurate the calculator can be. The symbols MAXR and MINR can help to understand the limits of the calculator. These symbols are the largest positive number and the smallest positive number which can be represented in a real number on the calculator. You can use the "■→Num" button to convert these symbols to numbers if you are curious what they are.

If your result is larger than MAXR or smaller than MINR, the calculator will not give you the result you expect. But, there are also situations where the value of a calculation may not be what you expect. In double precision format, a number can only be represented with up to 16 digits of precision. If you subtract two numbers which you believe to be different but are only different in the digits beyond the first 16, the result may end up being 0 even though you might have expected a non-zero answer. An example of this would be adding 1E20 and 1E-20 and then subtracting 1E20. Even though the answer should be 1E-20, the calculator will give 0 as its answer. The problem is that 1E20 plus 1E-20 is still 1E20 to the calculator. It would need more than 40 digits of precision to accurately add those two numbers. Instead the addition has no affect on the very large number.

For most uses, you don't need to be aware of these kinds of limitations and most calculators have them. But, if you are seeing results you don't expect, this might be why.

# Manipulating Real Numbers:

There are many operations which you can use when working with real numbers. The standard addition, subtraction, multiplication and division operations are obvious. Here are some links to reference material which are relevant for real numbers: