This math library is capable of being operated in several
different compatibility modes. These options deal solely with how
errors are handled.
There are 4 compatibility modes: ANSI/POSIX 1003.1;
IEEE-754; X/Open Portability Guide issue 3 (XPG3); and
System V Interface Definition Edition 3.
In IEEE mode, the matherr() function
(see below) is never called, no warning messages are printed on
the stderr output stream, and errno is never set.
In ANSI/POSIX mode, errno is set correctly,
but matherr() is never called and no warning messages
are printed on the stderr output stream.
In X/Open mode, errno is set correctly,
matherr() is called, but no warning messages are printed
on the stderr output stream.
In SVID mode, functions which overflow return
a value HUGE (defined in math.h), which is the maximum
single precision floating point value (as opposed to
HUGE_VAL which is meant to stand for infinity). errno is
set correctly and matherr() is called. If
matherr() returns 0, warning messages are printed on
the stderr output stream for some errors.
The mode can be compiled-in as IEEE-only, or any one of the
above methods settable at run-time.
Note: This math library assumes that the hardware (or software floating
point emulation) supports IEEE-754 style arithmetic, 32-bit 2's
complement integer arithmetic, doubles are in 64-bit IEEE-754 format.
With the appropriate configuration options set below, the
math library is fully thread-safe if:
Depending on the compatibility mode, the
setting of the errno variable from the C library is
thread-safe
Depending on the compatibility mode, sending error messages
to the stderr output stream using the C library
fputs()
function is thread-safe
Depending on the compatibility mode, the user-supplied
matherr()
function and anything it depends on are thread-safe
In addition, with the exception of the gamma*() and lgamma*() functions,
the math library is reentrant (and thus safe to use from interrupt handlers)
if the Math library is always in IEEE mode.