These are intended for use with computer problems. Note that hex numbers are input and displayed with &h prefix and & suffix, e.g. &h001A&. Napier allows mixing decimal and hex numbers in one expression. Also remember that all numbers, including hex numbers are saved internally as floating point numbers, so if you are doing divides of hex numbers, you might want to use the integer divide operator \ (backslash), rather than the normal /(forward slash) divide.
|
Fix |
|
|
|
Fix(real value) = integer |
|
|
Fix(3.8) = 3.0 |
|
&h& |
|
|
|
Hex format: &hFFFFFFFF& |
|
|
Specifies a hexadecimal number |
|
And |
|
|
|
val1 AND val2 |
|
Or |
|
|
|
va11 OR val2 |
|
Not |
|
|
|
NOT val |
|
Xor |
|
|
|
val1 Xor val2 |
|
SHL |
|
|
|
SHL(val, count) |
|
|
Ý= va1 << count |
|
|
SHL(&h0001&, 1) = &h0002& |
|
SHR |
|
|
|
SHR(val, count) |
|
|
Ý= va1 >> count |
|
|
SHR(&h0010&, 1) = &h0008& |
|
\ |
|
|
|
Integer divide 3\2 = 1 |
|
Log2 |
|
|
|
Log2(val) = log base 2 of val |
|
2^ |
|
|
|
Raise 2 to a power |
|
Txt |
|
|
|
Txt("text") = ASCII code |
|
|
Converts first 4 chars |
|
Mod |
|
|
|
3 Mod 2 = 2 |
|
|
Remainder of integer divide |
|
A |
|
|
|
Hex A |
|
|
= 10 |
|
B |
|
|
|
Hex B |
|
|
= 11 |
|
C |
|
|
|
Hex C |
|
|
= 12 |
|
D |
|
|
|
Hex D |
|
|
= 13 |
|
E |
|
|
|
Hex E |
|
|
= 14 |
|
F |
|
|
|
Hex F |
|
|
= 15 |