164
Chapter 15: Expressions and The Expression Stack
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
Integer value Tagged integer representation
L
5 5 1 NEGATIVE_INTEGER_TAG
256 0 1 2 NONNEGATIVE_INTEGER_TAG
65538 2 0 1 3 NONNEGATIVE_INTEGER_TAG
L
1000000 64 66 15 3 NEGATIVE_INTEGER_TAG
Table 15.2: Tagged Integer Examples
The integer zero is a special case in this representation. Zero has no integer
magnitude but is represented simply by a NONNEGATIVE_INTEGER_TAG on
top of a zero length field as follows, 0 NONNEGATIVE_INTEGER_TAG. Note
that this is the only valid representation of a simple tagged integer zero. The
system never generates nor expects a NEGATIVE_INTEGER_TAG on top of a 0
length field nor any tagged integer with a nonzero length field and a zero
magnitude. These invalid representations will cause unexpected system
behavior.
Fractions include two sized integer magnitudes — one for the numerator and one
for the denominator. A positive fraction is identified by a
POSITIVE_FRACTION_TAG. A negative fraction is identified by a
NEGATIVE_FRACTION_TAG. The denominator is placed deepest in the
representation, then the numerator, then the tag on top. Fractions are always
fully reduced, that is, the greatest common divisor of the numerator and
denominator is 1.
Fraction value Tagged fraction representation
1/2 2 1 1 1 POSTIVE_FRACTION_TAG
L
2/3 3 1 2 1 NEGATIVE_FRACTION_TAG
5/256 0 1 2 5 1 POSITIVE_FRACTION_TAG
L
999999/1000000 64 66 15 3 63 66 15 3 NEGATIVE_FRACTION_TAG
Table 15.3: Tagged Fraction Examples
The fraction representation includes two special cases. They are called signed
zeros. Signed zeros occur when the system performs symbolic operations such
as computing limits or simplifying expressions involving infinity. They are
represented by a fraction whose numerator is 0 and whose denominator is 1.
Thus, +0 is 1 1 0 POSITIVE_FRACTION_TAG, and
L
0 is 1 1 0
NEGATIVE_FRACTION_TAG. These are the only valid fractions with a zero
numerator, and the denominator must be 1. The system does not generate nor
expect any other fraction whose numerator or denominator is zero. Invalid
fractions will cause unexpected behavior.