Texas Instruments TI89 Developer Guide - Page 227
Rational Numbers, EStack Arithmetic, Appendix B: Global Variables - Direct Floating Point Operations
![]() |
UPC - 033317198566
View all Texas Instruments TI89 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 227 highlights
Chapter 16: Working with Numbers 185 16.5. 16.6. number into a BCD16 float value. push_Float as previously described is the primary routine for converting a BCD16 float value into a tagged float value on the expression stack. See Appendix B: Global Variables - Direct Floating Point Operations for details on commonly used stored BCD16 values and how to access them. Also see Appendix B: Global Variables - Math for a description of global EStackIndexes of stored floating point values. Rational Numbers The rational system operates on the expression stack. The range of tagged integers is approximately from -10^614 to 10^614, which is much larger than the range of C integer variables. This is the opposite situation from the float system. Any C integer can be converted to a tagged integer, but most tagged integers are too large to fit in C integer variables. Also C does not support a "fraction" variable type to correspond to tagged fractions. The system provides some routines to convert between C integers and tagged integers. push_long_to_integer, push_ulong_to_integer, and push_ushort_to_integer provide the means to convert C integers to tagged integers on the estack. estack_to_short and estack_to_ushort convert tagged integers to C integers. See Appendix A: System Routines - EStack Utilities for descriptions of these routines. Since the float range is bigger than the rational range, rational overflows and underflows quietly convert to float values. Clearly any rational value can be converted to a corresponding float value, but some floats are outside the rational range and cannot be converted to rational values. estack_number_to_Float is the primary routine for converting rational values to floating-point values. push_Float_to_rat is the primary routine for converting floating-point values to rational values. See Appendix A: System Routines for descriptions of these routines. See Appendix B: Global Variables - Math for a description of global EStackIndexes of stored rational values. EStack Arithmetic Performing numeric operations on the expression stack is simple, because the system routines understand all the tagged data types in the internal tokenized form and how to operate on them appropriately. For example, to add two values, simply pass the two values to the push_sum routine. push_sum understands tagged integers, tagged fractions, tagged floats, and in fact, all algebraic data TI-89 / TI-92 Plus Developer Guide Not for Distribution Beta Version January 26, 2001
![](/manual_guide/products/texas-instruments-ti89-developer-guide-95b636f/227.png)