Go to main content
Oracle Developer Studio 12.5 Man Pages

Exit Print View

Updated: June 2017
 
 

intro(3M)

Name

Intro, intro - introduction to Oracle Developer Studio mathematical library functions

Synopsis

cc [ flag ... ] file ...  -lsunmath -lm [ library ... ]

Description

The Oracle Developer Studio math library, libsunmath, provides several useful nonstandard mathematical functions and routines that support IEEE 754-1985 floating point arithmetic. libsunmath is provided as a shared object and as a static archive. Both forms are located in the compiler products area, typically installed under /opt/SUNWspro.

The header file <sunmath.h> defines types and constants and provides prototypes for the functions in libsunmath. This header file is also located in the compiler products area.

Some functions in libsunmath depend on functions in libm, the Solaris system math library. Therefore, C programs that use libsunmath should be linked with the compiler options -lsunmath -lm.

The functions in libsunmath are documented in section 3M of the compiler products man pages, typically found in /opt/developerstudio12.5/man on Solaris and /opt/oracle/developerstudio12.5/man on Linux.

See libm(3LIB) for information about the functions in libm.

See Also

Intro (3) , fenv.h (3HEAD) , math.h (3HEAD) , libm (3LIB)

Notes

The functions in libsunmath that are specified by IEEE 754-1985 handle special cases and exceptions in accordance with the standard. The functions in libsunmath that are not specified by IEEE 754-1985 handle special cases and exceptions in the spirit of the standard, analogous to the way these cases are handled by functions in libm when either the -xlibmieee compiler flag or the -xc99 compiler flag is specified. Functions whose values are generally not exactly representable, such as the scaled trigonometric functions or the financial functions, deliver results that are accurate to within a few units in the last place. They may not be correctly rounded according to the prevailing rounding modes, however, and the inexact exception may not be treated correctly (i.e., raised or not raised, as appropriate).

libsunmath contains many functions that were not previously in libm but have been added to it as of Solaris 10. Therefore, when a program that uses these functions is linked with the options -lsunmath -lm, it will invoke the functions in libsunmath rather than those in libm. If the same program is linked with -lm only, it will invoke the functions in libm. In some cases, the functions in libm may deliver results that differ slightly (by at most a few units in the last place) from the same functions in libsunmath.