English
Language : 

CC78K4 Datasheet, PDF (255/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 10 LIBRARY FUNCTIONS
7-23 matherr
Mathematical Functions
FUNCTION
matherr performs exception processing of the library that deals with floating-point numbers.
HEADER
math.h
FUNCTION PROTOTYPE
void matherr (struct exception *x) ;
Function
matherr
Arguments
struct exception {
int type;
char *name;
}
type ..... numeric value to
indicate
arithmetic exception
name ... function name
Return Value
None
EXPLANATION
• When an exception is generated, matherr is automatically called in the standard and runtime libraries that
deal with floating-point numbers.
• When called from the standard library, EDOM and ERANGE are set to errno.
The following shows the relationship between the arithmetic exception type and errno.
Type
1
2
3
4
5
Arithmetic Exception
Underflow
Annihilation
Overflow
Zero division
Inoperable
Value Set to errno
ERANGE
ERANGE
ERANGE
EDOM
EDOM
Original error processing can be performed by changing or creating matherr.
User’s Manual U15556EJ1V0UM
255