Numerical Entries
In addition to entering regular base 10 numbers there are 3 additional ways to represent numbers in a program: scientific notation, binary, and hexadecimal.
Formats for Entering Numbers in CRBasic |
||
---|---|---|
Format |
Example |
Value |
Standard | 6.832 | 6.832 |
Scientific notation | 5.67E-8 | 5.67X10-8 |
Binary: | &B1101 | 13 |
Hexadecimal | &HFF | 255 |
The binary format makes it easy to visualize operations where the ones and zeros translate into specific commands. For example, a block of ports can be set with a number, the binary form of which represents the status of the ports (1= high, 0=low). To set ports 1, 3, 4, and 6 high and 2, 5, 7, and 8 low; the number is &B00101101. The least significant bit is on the right and represents port 1. This is much easier to visualize than entering 72, the decimal equivalent.