_LIB_VERSION_TYPE _NutLibMSetLibraryType (_LIB_VERSION_TYPE newtype);
The math library can be configured to handle floating point exceptions in several different ways depending upon the desired level of standards conformance. There are currently 4 different personalities that are supported:
The IEEE personality level is used to indicate conformance to IEEE 754. When a math exception is raised while the math library is in IEEE mode, the math library returns the value that is specified for the exception in question, but no other action is taken.
In POSIX mode, the exception is handled by causing the floating point function to set the errno variable to indicate the type of exception. No other action is taken.
In the XOpen mode, the matherr function is called to notify the user application of the math exception. In the event that the
matherr()function returns a 0 value, then an error message is displayed on stderr and the errno value is set, as specified.
0.0 is usually returned, errno is set to EDOM, and a message is usually printed on standard error.
The largest finite single-precision number, HUGE of appropriate sign is returned, errno is set to EDOM, and a message is printed on standard error.
The largest finite single-precision number, HUGE of appropriate sign is usually returned, errno is set to ERANGE.
0.0 is returned, and errno is set to ERANGE.
0.0 is returned, errno is set to ERANGE, and a message is printed on standard error. In general, errno is not a reliable error indicator in that it may be unexpectedly set by a function in a handler for an asynchronous signal.
Further information regarding the behavior in the event an exception is raised is discussed in the individual reference pages for each math function.
The return value is the previous math library personality mode.
At high levels of optimization, the Microsoft C compiler may replace calls
with certain floating point functions with calls to the floating point
In this case, no exception information is reported, and the math library
behaves as if in IEEE mode—the benefit in such situations is that
the performance is improved.
Applications that need to know about math exceptions (either through the
errno variable, or through
The set of floating point functions that have a true intrinsic form depends upon the compiler in use and the hardware on which the application is running. For the Microsoft C and C++ compilers, please see the compiler documentation for "#pragma intrinsic" for more information.
Some types of floating point exceptions, such as a floating point divide
by zero, are not covered by the math library personality, and these exceptions
do not cause errno to be set or the
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
PTC MKS Toolkit 10.3 Documentation Build 39.