Ck_Valid_Float - Texas Instruments TI-89 Developer's Manual

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

Advertisement

392
Appendix A: System Routines — Direct Floating Point Operations

ck_valid_float

Declaration:
BOOL ck_valid_float (BCD16 * num )
Category:
Direct Floating Point Operations
Description:
Verifies that a floating-point value is within the valid user range. The
internal TI BCD floating-point format has 16 mantissa digits with an
exponent range of -16384 to 16383 while a valid user float is 14 mantissa
digits with an exponent range of -999 to 999. ck_valid_float rounds the
input BCD16 value num to 14 digits and underflows the value to 0 if the
exponent is less than -999. If num is NAN or the exponent is greater than
999, FALSE is returned and num will contain a NAN. (See section
2.9.4. Floating-Point Representations in the TI-89 / TI-92 Plus Sierra C
Assembler Reference Manual.)
Inputs:
num — Pointer to a TI BCD floating-point value (BCD16).
Outputs:
num is rounded to 14 mantissa digits or underflowed to 0 if necessary to
insure that its contents are within the range of a user floating-point value. In
this case, TRUE will be returned. If the input num is NAN or the exponent is
greater than 999, the output value of num will be NAN and FALSE will be
returned.
Assumptions:
None
Side Effects:
None
Availability:
All versions of the TI-89 / TI-92 Plus.
TI-89 / TI-92 Plus
Differences:
None
See Also:
is_float_transfinite, push_Float
Example:
/* convert an internal floating point value to the range of a user float */
if( !ck_valid_float( &temp ))
ER_throw( ER_OVERFLOW );
TI-89 / TI-92 Plus Developer Guide
/* does round14 and underflows if necessary */
/* could not convert to valid user float range */
Not for Distribution
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