Numbers - Texas Instruments TI-89 Developer's Manual

Graphing calculator
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

Chapter 15: Expressions and The Expression Stack
constants true and false, and most built-in mathematics functions and operators
are represented using a single tag. Floating-point numbers, rational numbers,
and integer numbers each require an identifier tag on top of the standard
representation of the number. All of the tag values are defined in tiams.h. Each of
the tag names ends with the characters "_TAG." The following sections describe
the various tags and what they identify or represent.
15.2.2.

Numbers

The Operating System includes two separate number systems — the rational
number system which contains tagged integers and tagged fractions, and the
floating-point number system, which uses Binary Coded Decimal (BCD)
floating-point numbers. A primary difference between these number systems is
that the rational system is by definition exact and the floating-point system is
assumed always to be an approximation.
In the rational system the number of digits is limited but not fixed. If an arithmetic
operation on two rational numbers completes successfully, then the result is
exact. No loss of precision occurs. In the floating-point system the number of
digits is fixed, and therefore, loss of precision is always a possibility. Thus, the
result of a floating-point operation is considered to be an approximation.
The rational numbers include tagged integers and tagged fractions. The term
tagged integer is used to distinguish these numbers from the C programming
types — int, short, long, etc. A tagged integer has three elements — a tag at the
highest address, a length, and a magnitude.
An integer magnitude is represented as a sequence of adjacent quantums, with
the least significant quantum deepest (lowest address) and the most significant
quantum nonzero. For example, the 16 bit integer 65534 (0xFFFE) would appear
as 254 255 (0xFE 0xFF) with the least significant quantum deepest.
A sized integer magnitude is a one-quantum length field on top of an integer
magnitude. With the quantum size of one byte, the length can be 0 through 255
quantums, and the maximum possible sized integer magnitude is
255
256
– 1 10
appear as 254 255 2 (0xFE 0xFF 0x2).
A non-negative integer is represented as a NONNEGATIVE_INTEGER_TAG on
top of a sized integer magnitude. Thus, the tagged integer representation of the
integer 65534 is 254 255 2 NONNEGATIVE_INTEGER_TAG.
A negative integer is represented as a NEGATIVE_INTEGER_TAG on top of a
sized integer magnitude. So, the tagged integer representation of the negative
integer L65534 is 254 255 2 NEGATIVE_INTEGER_TAG.
TI-89 / TI-92 Plus Developer Guide
614
. Thus, the sized integer magnitude for the integer 65534 would
Not for Distribution
163
Beta Version January 26, 2001

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92 plusTi-92 plus

Table of Contents