Header Files
7-6
7.2.3 Error Reporting
(errno.h)
Errors can occur in a math function if invalid parameter values are passed to
the function or if the function returns a result that is outside the defined range
for the type of the result. When this happens, a variable named
errno
is set to
the value of one of the following macros:
-
EDOM, for domain errors (invalid parameter)
-
ERANGE, for range errors (invalid result)
C code that calls a math function can read the value of errno to check for error
conditions. The errno variable is declared in errno.h and defined in errno.c.
7.2.4 Limits (float.h and limits.h)
The float.h and limits.h headers define macros that expand to useful limits and
parameters of the TMS320C2x/C2xx/C5x’s numeric representations.
Table 7
2 list these macros and their limits.
Table 7
−
1. Macros That Supply Integer Type Range Limits
(
limits.h
)
Macro
Value
Description
CHAR_BIT
16
Maximum number of bits for the smallest
object that is not a bit field
SCHAR_MIN
−
32768
Minimum value for a signed char
SCHAR_MAX
32767
Maximum value for a signed char
UCHAR_MAX
65535
Maximum value for an unsigned char
CHAR_MIN
SCHAR_MIN
Minimum value for a char
CHAR_MAX
SCHAR_MAX
Maximum value for a char
SHRT_MIN
−
32768
Minimum value for a short int
SHRT_MAX
32767
Maximum value for a short int
USHRT_MAX
65535
Maximum value for an unsigned short int
INT_MIN
−
32768
Minimum value for an int
INT_MAX
32767
Maximum value for an int
UINT_MAX
65535
Maximum value for an unsigned int
LONG_MIN
−
2147483648
Minimum value for a long int
LONG_MAX
2147483647
Maximum value for a long int
ULONG_MAX
4294967295
Maximum value for an unsigned long int
Summary of Contents for TMS320C2x
Page 8: ...viii...
Page 69: ...2 47 C Compiler Description...
Page 159: ...6 36...
Page 226: ...8 6...