Sorry, your browser is not supported. We recommend upgrading your browser.
We have done our best to make all the documentation and resources available on old versions of Internet Explorer, but vector image support and the layout may not be optimal. Technical documentation is available as a PDF Download.
C99-compatible functions for controlling the ARM floating-point environment
The compiler supports all functions defined in the C99 standard, and functions that are not C99-standard. The C99-compatible functions are the only interface that enables you to install custom exception trap handlers with the ability to define your own return value. All the function prototypes, data types, and macros for this functionality are defined in fenv.h.
Exception flag handling
The feclearexcept(), fetestexcept(), and feraiseexcept() functions let you clear, test and raise exceptions. The fegetexceptflag() and fesetexceptflag() functions let you save and restore information about a given exception.
ARM floating-point compiler extensions to the C99 interface
The ARM C library provides some extensions to the C99 interface to enable it to do everything that the ARM floating-point environment is capable of. This includes trapping and untrapping individual exception types, and installing custom trap handlers.
Writing a custom exception trap handler
Custom exception trap handlers let you override the default exception handling behavior. For example, when converting Fortran code you might want to override the division by zero exception to return 1 rather than an invalid operation exception.
IEEE 754 arithmetic
The ARM floating-point environment is an implementation of the IEEE 754 standard for binary floating-point arithmetic.
Basic data types for IEEE 754 arithmetic
ARM floating-point values are stored in one of two data types, single-precision and double-precision. In this documentation, they are called float and double, these being the corresponding C data types.
Exceptions arising from IEEE 754 floating-point arithmetic
Floating-point arithmetic operations can run into various problems. For example, the result computed might be either too big or too small to fit into the format, or there might be no way to calculate the result (as in trying to take the square root of a negative number, or trying to divide zero by zero). These are known as exceptions, because they indicate unusual or exceptional situations.