|
| Previous: 2.5 Factors | TOC | Index | Back | Next: 2.6 Expressions |
Numeric entities usually carry a sign in T3X. This means that a part of the bit pattern representing a number is reserved to indicate the number's sign (positive or negative). On two's-complement machines, the most significant bit (high bit) contains the sign flag. If this bit is set, the number is negative and otherwise it is positive. Therefore, the numeric range of the Tcode machine includes the values -2147483647 to 2147483647 (in bit patterns 0xffffffff to 0x7fffffff).
Under some circumstances, it is desirable to interpret a number as an unsigned entity instead (for example when comparing offsets). In this document, a leading dot is used to indicate an unsigned number. In T3X itself, no such notation exists, but some operators may be modified with a leading dot in order to turn them into 'unsigned' operators. Unsigned operators treat the sign bit as a part of the value. Therefore, the domain of these operators is {0,...,4294967296} rather than {-2147483647,...,2147483647}.
[Note: Unsigned values not contained in the signed domain may not be expressed in the form of numeric literals in T3X.]
-1 and 4294967296 represent the same value to them on two's-complement machines. To avoid confusion, signed and unsigned operators should only be applied to the following ranges:
| Range | Operators |
|---|---|
| -2147483647...2147483647 | signed: * / < > <= >= |
| 0...4294967296 | unsigned: .* ./ .< .> .<= .>= |
| Previous: 2.5 Factors | TOC | Index | Back | Next: 2.6 Expressions |