

Technical Support OnLine Manuals Libraries and Floating Point Support Guide Preface The ARM C and C++ Libraries The ARM C Microlibrary Floatingpoint Support About floatingpoint support The software floatingpoint library, fplib Calling fplib routines fplib arithmetic on numbers in a particular format fplib conversions between floats, long longs, doub fplib comparisons between floats and doubles fplib C99 functions Controlling the ARM floatingpoint environment Floatingpoint functions for compatibility with Mi C99compatible functions for controlling the ARM f C99 rounding mode and floatingpoint exception mac Exception flag handling Functions for handling rounding modes Functions for saving and restoring the whole float Functions for temporarily disabling exceptions ARM floatingpoint compiler extensions to the C99 Writing a custom exception trap handler Example of a custom exception handler Exception trap handling by signals mathlib double and singleprecision floatingpoint IEEE 754 arithmetic Basic data types for IEEE 754 arithmetic Single precision data type for IEEE 754 arithmetic Double precision data type for IEEE 754 arithmetic Sample single precision floatingpoint values for Sample double precision floatingpoint values for IEEE 754 arithmetic and rounding Exceptions arising from IEEE 754 floatingpoint ar Exception types recognized by the ARM floatingpoi Using the Vector FloatingPoint (VFP) support libr The C and C++ Library Functions reference Floatingpoint Support Functions Reference 
fplib arithmetic on numbers in a particular format
3.2.2 fplib arithmetic on numbers in a particular formatfplib provides a number of routines to perform arithmetic on numbers in a particular format. The following table describes these routines. Arguments
and return types are always in the same format.
Table 31 Arithmetic routines
Related referenceRelated information^{a}
Functions that perform the IEEE 754 remainder operation.
This is defined to take two numbers, x and y,
and return a number z so that z =
x – ny, where n is an integer.
To return an exactly correct result, n is chosen
so that z is no bigger than half of x (so
that z might be negative even if both x and y are
positive). The IEEE 754 remainder function is not the same as the
operation performed by the C library function
fmod ,
where z always has the same sign as x.
Where the IEEE 754 specification gives two acceptable choices of n,
the even one is chosen. This behavior occurs independently of the
current rounding mode.^{b}
Functions that perform the IEEE 754 roundtointeger operation. This takes a number and rounds it
to an integer (in accordance with the current rounding mode), but returns that integer
in the floatingpoint number format rather than as a C
int
variable. To convert a number to an int variable, you must
use the _ffix routines.^{c}
The IEEE 754
remainder() function
is a synonym for _drem . remainder() is defined
in math.h.  

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.