Base-N Calculations
Base-N Modes
In DreamCalc, base-N calculations are performed in one of three modes, as follows.
- Floating Point Base-N Mode
- Floating point values with 8 byte mantissa & independent sign.
- 64 Bit 2s Complement Integer
- Integer values only of 8 bytes or less.
- 32 Bit 2s Complement Integer
- Integer values only of 4 bytes or less.
These are distinct from the "Normal Math" mode, even if you set the radix to be decimal. When base-N is enabled, you have the option of selecting the radix and performing LOGIC calculations. You also have the ability to perform mathematical calculations, but you should be aware of base-N range restrictions and integer rounding.
To change the base-N mode, use the Modes->Base-N Modes main menu. Alternatively, use the calculator's [MODE] key.
Integer 2s Complement Arithmetic
In 2s complement arithmetic, negative numbers are represented as the value that, when added to a positive number of the same magnitude, equals zero. A negative value is formed by complementing each binary bit of the positive number, and then adding 1. For negative values, the most significant bit (MSB) is always 1. This arithmetic is commonly used by computers when dealing with integers.
In decimal, the minus sign character is used to indicate negative values, but in all other bases it is not shown.
Here is an example in the 32 bit integer mode for hexadecimal radix:
1
[-]
2
[ENTER]
Displays: FFFF FFFF
Converting this value to decimal will show -1.
Hint: In the Numeric Screen page of the Options Window, you will find an option to show negative values in red. This setting will highlight negative 2s complement values.
Floating Point Mode
In floating point base-N mode, 2s complement arithmetic is not used and the sign is held independently. Thus, there are 64 bits of precision plus one extra sign flag. In this mode, the decimal value -1 will be shown as -0x1 when converted to hexadecimal.
The permissable numerical range in floating point base-n mode is +/-18446744073709551615. In the decimal radix, therefore, a maximum of 20 digits is allowed where necessary, but often DreamCalc will present results using only 18 decimal digits. This behavior is normal and ensures accuracy of +/-1 of the last digit. Similarly, rounding is done in other radix as applicable. |