This file documents an ANSI-C conforming mathematical subroutine library.

Copyright (C) 1992, 1993, 1995, 1996-2014 Red Hat, Inc.

libm includes software developed at SunPro, a Sun Microsystems, Inc. business.  Permission to use, copy, modify, and distribute this software is freely granted, provided that this notice is preserved.

Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.

Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, subject to the terms of the GNU General Public License, which includes the provision that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.

Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.

LIBM
****

     [file targetdep.tex not included]

Reentrancy Properties of libm
*****************************

When a libm function detects an exceptional case, errno may be set, the matherr function may be called, and a error message may be written to the standard error stream.  This behavior may not be reentrant.

With reentrant C libraries like the Red Hat newlib C library, errno is a macro which expands to the per-thread error value.  This makes it thread safe.

When the user provides his own matherr function it must be reentrant for the math library as a whole to be reentrant.

In normal debugged programs, there are usually no math subroutine errors---and therefore no assignments to errno and no matherr calls; in that situation, the math functions behave reentrantly.

The long double function support of libm
****************************************

Currently, the full set of long double math functions is only provided on platforms where long double equals double. For such platforms, the long double math functions are implemented as calls to the double versions.