Scientific Calculator on BREW "psec" - 5 / 7 -
5. The Integer and Real Number Modes
5.1. Various calculation modes
psec has 2 calculation modes: integer mode and real number (decimal) mode.
Decimal numbers and functions can be used in real number mode.
Integer mode does not allow functions, but performs bit operations.
The mode can be switched at application boot up, or after inputting a formula and pressing the "=" key.
The "CNT" key continues formula editing, and the "OFF" key quits the application.
The "Hex", "Dec", "Oct" and "Bin" keys on the 2nd line refer respectively to the "Hex mode ( base 16 )", "Decimal mode ( base 10 )", "Octal mode ( base 8 )" and "Binary mode ( base 2 )"
Only "Dec" is used for real number calculations, all other modes are for calculating integers. The keys on the 4th and 5th line change depending on the given mode (real number or integer) .
In real number mode, keys in the 4th line are from left to right: "Deg", "Rad", "Gra" and the ones on the 5th line are "UNT+" and "UNT-".
In integer mode, keys on the 4th line are "S", "U", "64", and those on the 5th line "32", "16" and "08".
Virtual Key | Display | Function | Actual key | |
---|---|---|---|---|
Decimal mode | Non-decimal mode | |||
CNT | ok | ok | Go back to formula editing mode | Clear |
OFF | ok | ok | Quit "psec" | Power |
Hex | ok | ok | Switch to hex input and display mode | 1 |
Dec | ok | ok | Switch to decimal number input and display mode | 2 |
Oct | ok | ok | Switch to octal input and display mode | 3 |
Bin | ok | ok | Switch to binary input and display mode | 4 |
Deg | ok | no | Switch angular unit to degree | 7 |
Rad | ok | no | Switch angular unit to radian | 8 |
Gra | ok | no | Switch angular unit to gradian | 9 |
UNT+ | ok | no | Increase unit system by 1 unit | 0 |
UNT- | ok | no | Decrease unit system by 1 unit | # |
S | no | ok | Gives a sign to the integer (same as modifier "signed" in C) |
7 |
U | no | ok | Gives no sign to the integer (same as modifier "unsigned" in C) |
8 |
64 | no | ok | Calculate integer in precision level of 64 bit. (same as long long type in C) |
9 |
32 | no | ok | Calculate integer in precision level of 32 bit. (same as long type in C) |
* |
16 | no | ok | Calculate integer in precision level of 16 bit. (same as short type in C) |
0 |
08 | no | ok | Calculate integer in precision level of 8 bit. (same as char type in C) |
# |
If mode is toggled when the result is displayed, result switches between real number and integer.
5.2. Real Number Mode
Angular Unit
Real number mode has 3 sub-modes depending on the chosen angular unit.
- Deg mode ( Angular unit is degrees )
- Rad mode ( Angular unit is radians )
- Gra mode ( Angular unit is gradians )
The choice of these sub-modes affects the results of trigonometric functions such as sin, cos, tan, asin, acos and atan.
When Deg is chosen, an input of "sin(30)" is interpreted as "sin(30°)", and the output will be 0.5.
Units
Real number mode allows the use of units that may be attached to the result, or may be changed after obtaining the result.
Pressing the "UNT+" key when the result is displayed, toggles to successively larger units ( K is the largest unit ). Pressing the "UNT-" key, toggles to smaller units ( m is the smallest unit ).
5.3. Integer Mode
In integer mode, numbers may be represented in 3 different base systems.
- Hex mode ( base 16 )
- Oct mode ( base 8 )
- Bin mode ( base 2 )
There are 8 additional sub-modes according to the precision of calculation.
- 64 bit mode ( with sign )
- 64 bit mode ( without sign )
- 32 bit mode ( with sign )
- 32 bit mode ( without sign )
- 16 bit mode ( with sign )
- 64 bit mode ( without sign )
- 8 bit mode ( with sign )
- 8 bit mode ( without sign )
The level of precision is changed using a combination of the "S" key( for signed ) or the "U" key (for unsigned) , along with the keys to set bit numbers: "64", "32", "16" and "8".
For instance, to set the "32 bit mode unsigned", press the "U" key, then the "32" key.
Pressing the "64", "32", "16"or "8" keys while the result is displayed, converts the result to a new precision mode.