Section 2: Compiler
63
TI
-
89 / TI
-
92 Plus Sierra C Assembler Reference Manual
Not for Distribution
Beta Version February 2, 2001
invalid floating-point representation (undefined or NAN)
Low address
High Address
2 bytes
MSD 8 bytes LSD
0x7FFF
0xAA000000, 0x00000000
Figure 2.3: Special Internal Floating-Point Representations
All of the special internal floating-point values are valid inputs to TI BCD
floating-point routines and will be handled correctly when encountered. It is not
necessary to check for them after every floating-point operation to detect
overflows or other special values. However, none of the special values shown
above can be directly entered on the TI-89 or TI-92 Plus calculators. The signed
zeros may result from a calculation but since they are displayed as 0. on the
calculator, they can only be recognized by their behavior in other calculations.
The infinities and invalid floating-point values must be converted to other
representations before being made available to the user. See chapter
16. Working with Numbers in the TI-89 / TI-92 Plus Developers Guide for
information on how and when to verify that the floating-point value is valid as
required by the calculator user floating-point representation and what to do when
it is not.
2.9.5. Enumeration
Types
An enumeration type is a set of integer values represented by identifiers; these
identifiers are referred to as enumeration constants. The declaration of an
enumeration type is similar to that of a structure or union type. For example, the
following declaration creates an enumeration type color — whose values are
red, green, blue, and white — and declares the variables boat and car to be of
this type:
enum color { red, green, blue = 8, white } boat, car;
The enumeration constants (red, green, blue, and white in the above example)
are assigned integer values when the enum type is created. Enumeration
constants are assigned either values generated automatically by the compiler or
values specified by an assignment operator and a constant integer expression.
When an explicit assignment is not made, the first enumeration constant in the
list is assigned the value zero; subsequent enumeration constants are assigned
the value of the previous constant plus one. In the above example, the
enumeration constants have the following values:
red = 0
green = 1
blue = 8
white = 9