2000-02-18 03:39:52 +08:00
|
|
|
\input texinfo.tex
|
|
|
|
@setfilename libm.info
|
|
|
|
|
|
|
|
@ifinfo
|
|
|
|
@format
|
2015-03-13 01:22:23 +08:00
|
|
|
@dircategory Newlib
|
|
|
|
@direntry
|
|
|
|
* libm: (libm). An ANSI-C conforming mathematical library.
|
|
|
|
@end direntry
|
2000-02-18 03:39:52 +08:00
|
|
|
@end format
|
|
|
|
@end ifinfo
|
|
|
|
|
|
|
|
@ifinfo
|
|
|
|
This file documents an ANSI-C conforming mathematical subroutine library.
|
|
|
|
|
2014-12-19 04:30:11 +08:00
|
|
|
Copyright (C) 1992, 1993, 1995, 1996-2014 Red Hat, Inc.
|
2000-02-18 03:39:52 +08:00
|
|
|
|
|
|
|
@file{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.
|
|
|
|
|
|
|
|
@ignore
|
|
|
|
Permission is granted to process this file through Tex and print the
|
|
|
|
results, provided the printed document carries copying permission
|
|
|
|
notice identical to this one except for the removal of this paragraph
|
|
|
|
(this paragraph not being relevant to the printed manual).
|
|
|
|
|
|
|
|
@end ignore
|
|
|
|
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.
|
|
|
|
@end ifinfo
|
|
|
|
@iftex
|
|
|
|
@finalout
|
|
|
|
@setchapternewpage odd
|
2002-07-23 00:40:48 +08:00
|
|
|
@settitle The Red Hat newlib C Math Library
|
2000-02-18 03:39:52 +08:00
|
|
|
@titlepage
|
2002-07-23 00:40:48 +08:00
|
|
|
@title The Red Hat newlib C Math Library
|
2000-02-18 03:39:52 +08:00
|
|
|
@sp 1
|
2023-03-30 17:09:33 +08:00
|
|
|
@subtitle @code{libm} 4.3.0
|
|
|
|
@subtitle January 2023
|
2023-12-17 17:01:45 +08:00
|
|
|
@author Steve Chamberlain
|
|
|
|
@author Roland Pesch
|
|
|
|
@author Red Hat Support
|
|
|
|
@author Jeff Johnston
|
2000-02-18 03:39:52 +08:00
|
|
|
@page
|
|
|
|
|
|
|
|
@tex
|
|
|
|
{\parskip=0pt
|
2002-07-23 00:40:48 +08:00
|
|
|
\hfill Red Hat Support\par
|
2000-02-18 03:39:52 +08:00
|
|
|
\hfill sac@@cygnus.com\par
|
|
|
|
\hfill pesch@@cygnus.com\par
|
2004-01-07 03:26:10 +08:00
|
|
|
\hfill jjohnstn@@redhat.com\par
|
2000-02-18 03:39:52 +08:00
|
|
|
}
|
|
|
|
\global\parindent=0pt % Steve likes it this way
|
|
|
|
@end tex
|
|
|
|
|
|
|
|
@vskip 0pt plus 1filll
|
2004-01-07 03:26:10 +08:00
|
|
|
Copyright @copyright{} 1992, 1993, 1994-2004 Red Hat, Inc.
|
2000-02-18 03:39:52 +08:00
|
|
|
|
|
|
|
@file{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.
|
|
|
|
@end titlepage
|
|
|
|
@end iftex
|
|
|
|
|
2013-04-30 04:02:34 +08:00
|
|
|
@ifnottex
|
2000-02-18 03:39:52 +08:00
|
|
|
@node Top
|
|
|
|
@top LIBM
|
2013-04-30 04:02:34 +08:00
|
|
|
@end ifnottex
|
2000-02-18 03:39:52 +08:00
|
|
|
|
|
|
|
@menu
|
|
|
|
* Math:: The mathematical functions (`math.h').
|
2010-10-18 Marco Atzeri <marco_atzeri@yahoo.it>
* libm/Makefile.am: added complex functions documentation
* libm/libm.texinfo: ditto
* libm/complex/Makefile.am: Ditto
* libm/complex/complex.tex: Ditto
* libm/complex/(cabs.c, cacos.c, cacosh.c, carg.c,
casin.c, casinh.c, catan.c, catanh.c, ccos.c, ccosh.c,
cexp.c, cimag.c, clog.c, conj.c, cpow.c, cproj.c, creal.c,
csin.c, csinh.c, csqrt.c, ctan.c, ctanh.c): Ditto
* libm/Makefile.in: Regenerate
* libm/complex/Makefile.in: Ditto
2010-10-19 06:40:24 +08:00
|
|
|
* Complex:: The mathematical complex functions (`complex.h').
|
2019-08-14 18:24:37 +08:00
|
|
|
* Fenv:: The floating point environment functions ('fenv.h').
|
2000-02-18 03:39:52 +08:00
|
|
|
* Reentrancy:: The functions in libm are not reentrant by default.
|
2009-04-16 Ken Werner <ken.werner@de.ibm.com>
* libm/libm.texinfo: Add long double function support chapter.
* libc/include/machine/ieeefp.h: Add _LDBL_EQ_DBL define.
* libc/include/stdlib.h: Include <machine/ieeefp.h>.
(strtold, wcstold): Declare.
* libc/stdlib/strtold.c: New File.
* libc/stdlib/wcstold.c: Likewise.
* libc/configure.in: Add long double check.
* libc/configure: Regenerate.
* libc/stdlib/Makefile.am: Add strtold.c and wcstold.c.
* libc/stdlib/Makefile.in: Regenerate.
* libc/include/math.h (atanl, cosl, sinl, tanl, tanhl): Declare.
(frexpl, modfl, ceill, fabsl, floorl, log1pl, expm1l, acosl): Ditto.
(asinl, atan2l, coshl, sinhl, expl, ldexpl, logl, log10l, powl): Ditto.
(sqrtl, fmodl, hypotl, copysignl, nanl, ilogbl, asinhl, cbrt): Ditto.
(nextafterl, rintl, scalbnl, exp2l, scalblnl, tgammal): Ditto.
(nearbyintl, lrintl, llrintl, roundl, lroundl, llround): Ditto.
(llroundl, truncl, remquol, fdiml, fmaxl, fminl, fmal, acoshl): Ditto.
(atanhl, remainderl, lgammal, erfl, erfcl): Ditto.
* libm/common/atanl.c: New File.
* libm/common/cosl.c: Likewise.
* libm/common/sinl.c: Likewise.
* libm/common/modfl.c: Likewise.
* libm/common/frexpl.c: Likewise.
* libm/common/tanhl.c: Likewise.
* libm/common/tanl.c: Likewise.
* libm/common/expm1l.c: Likewise.
* libm/common/log1pl.c: Likewise.
* libm/common/ceill.c: Likewise.
* libm/common/fabsl.c: Likewise.
* libm/common/floorl.c: Likewise.
* libm/common/acosl.c: Likewise.
* libm/common/asinl.c: Likewise.
* libm/common/atan2l.c: Likewise.
* libm/common/coshl.c: Likewise.
* libm/common/expl.c: Likewise.
* libm/common/fmodl.c: Likewise.
* libm/common/hypotl.c: Likewise.
* libm/common/ldexpl.c: Likewise.
* libm/common/log10l.c: Likewise.
* libm/common/logl.c: Likewise.
* libm/common/powl.c: Likewise.
* libm/common/sqrtl.c: Likewise.
* libm/common/copysignl.c: Likewise.
* libm/common/ilogbl.c: Likewise.
* libm/common/nanl.c: Likewise.
* libm/common/cbrtl.c: Likewise.
* libm/common/asinhl.c: Likewise.
* libm/common/nextafterl.c: Likewise.
* libm/common/rintl.c: Likewise.
* libm/common/scalbnl.c: Likewise.
* libm/common/exp2l.c: Likewise.
* libm/common/fdiml.c: Likewise.
* libm/common/fmal.c: Likewise.
* libm/common/fmaxl.c: Likewise.
* libm/common/fminl.c: Likewise.
* libm/common/lrintl.c: Likewise.
* libm/common/lroundl.c: Likewise.
* libm/common/nearbyintl.c: Likewise.
* libm/common/remquol.c: Likewise.
* libm/common/roundl.c: Likewise.
* libm/common/scalblnl.c: Likewise.
* libm/common/truncl.c: Likewise.
* libm/common/acoshl.c: Likewise.
* libm/common/atanhl.c: Likewise.
* libm/common/erfcl.c: Likewise.
* libm/common/erfl.c: Likewise.
* libm/common/lgammal.c: Likewise.
* libm/common/remainderl.c: Likewise.
* libm/common/tgammal.c: Likewise.
* libm/common/sinhl.c: Likewise.
* libm/common/llroundl.c: Likewise.
* libm/configure.in: Add long double check.
* libm/configure: Regenerate.
* libm/common/Makefile.am: Add new files.
* libm/common/Makefile.in: Regenerate.
2009-04-17 02:24:35 +08:00
|
|
|
* Long Double Functions:: The long double function support of libm.
|
2013-11-08 20:48:29 +08:00
|
|
|
* Document Index::
|
2000-02-18 03:39:52 +08:00
|
|
|
@end menu
|
|
|
|
|
|
|
|
@include targetdep.tex
|
|
|
|
|
|
|
|
@node Reentrancy
|
|
|
|
@chapter Reentrancy Properties of @code{libm}
|
|
|
|
|
|
|
|
@cindex reentrancy
|
|
|
|
@cindex @code{matherr} and reentrancy
|
|
|
|
When a libm function detects an exceptional case, @code{errno} may be
|
2018-12-07 00:14:01 +08:00
|
|
|
set.
|
2000-02-18 03:39:52 +08:00
|
|
|
|
|
|
|
@c The exact behavior depends on the currently selected error handling
|
2018-12-07 00:14:01 +08:00
|
|
|
@c mode (IEEE or POSIX).
|
2000-02-18 03:39:52 +08:00
|
|
|
|
2018-12-07 00:14:01 +08:00
|
|
|
@code{errno} is a macro which expands to the per-thread error value.
|
|
|
|
This makes it thread safe, and therefore reentrant.
|
2000-02-18 03:39:52 +08:00
|
|
|
|
2009-04-16 Ken Werner <ken.werner@de.ibm.com>
* libm/libm.texinfo: Add long double function support chapter.
* libc/include/machine/ieeefp.h: Add _LDBL_EQ_DBL define.
* libc/include/stdlib.h: Include <machine/ieeefp.h>.
(strtold, wcstold): Declare.
* libc/stdlib/strtold.c: New File.
* libc/stdlib/wcstold.c: Likewise.
* libc/configure.in: Add long double check.
* libc/configure: Regenerate.
* libc/stdlib/Makefile.am: Add strtold.c and wcstold.c.
* libc/stdlib/Makefile.in: Regenerate.
* libc/include/math.h (atanl, cosl, sinl, tanl, tanhl): Declare.
(frexpl, modfl, ceill, fabsl, floorl, log1pl, expm1l, acosl): Ditto.
(asinl, atan2l, coshl, sinhl, expl, ldexpl, logl, log10l, powl): Ditto.
(sqrtl, fmodl, hypotl, copysignl, nanl, ilogbl, asinhl, cbrt): Ditto.
(nextafterl, rintl, scalbnl, exp2l, scalblnl, tgammal): Ditto.
(nearbyintl, lrintl, llrintl, roundl, lroundl, llround): Ditto.
(llroundl, truncl, remquol, fdiml, fmaxl, fminl, fmal, acoshl): Ditto.
(atanhl, remainderl, lgammal, erfl, erfcl): Ditto.
* libm/common/atanl.c: New File.
* libm/common/cosl.c: Likewise.
* libm/common/sinl.c: Likewise.
* libm/common/modfl.c: Likewise.
* libm/common/frexpl.c: Likewise.
* libm/common/tanhl.c: Likewise.
* libm/common/tanl.c: Likewise.
* libm/common/expm1l.c: Likewise.
* libm/common/log1pl.c: Likewise.
* libm/common/ceill.c: Likewise.
* libm/common/fabsl.c: Likewise.
* libm/common/floorl.c: Likewise.
* libm/common/acosl.c: Likewise.
* libm/common/asinl.c: Likewise.
* libm/common/atan2l.c: Likewise.
* libm/common/coshl.c: Likewise.
* libm/common/expl.c: Likewise.
* libm/common/fmodl.c: Likewise.
* libm/common/hypotl.c: Likewise.
* libm/common/ldexpl.c: Likewise.
* libm/common/log10l.c: Likewise.
* libm/common/logl.c: Likewise.
* libm/common/powl.c: Likewise.
* libm/common/sqrtl.c: Likewise.
* libm/common/copysignl.c: Likewise.
* libm/common/ilogbl.c: Likewise.
* libm/common/nanl.c: Likewise.
* libm/common/cbrtl.c: Likewise.
* libm/common/asinhl.c: Likewise.
* libm/common/nextafterl.c: Likewise.
* libm/common/rintl.c: Likewise.
* libm/common/scalbnl.c: Likewise.
* libm/common/exp2l.c: Likewise.
* libm/common/fdiml.c: Likewise.
* libm/common/fmal.c: Likewise.
* libm/common/fmaxl.c: Likewise.
* libm/common/fminl.c: Likewise.
* libm/common/lrintl.c: Likewise.
* libm/common/lroundl.c: Likewise.
* libm/common/nearbyintl.c: Likewise.
* libm/common/remquol.c: Likewise.
* libm/common/roundl.c: Likewise.
* libm/common/scalblnl.c: Likewise.
* libm/common/truncl.c: Likewise.
* libm/common/acoshl.c: Likewise.
* libm/common/atanhl.c: Likewise.
* libm/common/erfcl.c: Likewise.
* libm/common/erfl.c: Likewise.
* libm/common/lgammal.c: Likewise.
* libm/common/remainderl.c: Likewise.
* libm/common/tgammal.c: Likewise.
* libm/common/sinhl.c: Likewise.
* libm/common/llroundl.c: Likewise.
* libm/configure.in: Add long double check.
* libm/configure: Regenerate.
* libm/common/Makefile.am: Add new files.
* libm/common/Makefile.in: Regenerate.
2009-04-17 02:24:35 +08:00
|
|
|
@node Long Double Functions
|
|
|
|
@chapter The long double function support of @code{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.
|
2013-11-08 20:48:29 +08:00
|
|
|
@node Document Index
|
|
|
|
@unnumbered Document Index
|
2000-02-18 03:39:52 +08:00
|
|
|
@printindex cp
|
|
|
|
|
|
|
|
@tex
|
2013-04-30 04:02:34 +08:00
|
|
|
% I think something like @@colophon should be in texinfo. In the
|
2000-02-18 03:39:52 +08:00
|
|
|
% meantime:
|
|
|
|
\long\def\colophon{\hbox to0pt{}\vfill
|
|
|
|
\centerline{The body of this manual is set in}
|
|
|
|
\centerline{\fontname\tenrm,}
|
|
|
|
\centerline{with headings in {\bf\fontname\tenbf}}
|
|
|
|
\centerline{and examples in {\tt\fontname\tentt}.}
|
|
|
|
\centerline{{\it\fontname\tenit\/} and}
|
|
|
|
\centerline{{\sl\fontname\tensl\/}}
|
|
|
|
\centerline{are used for emphasis.}\vfill}
|
|
|
|
\page\colophon
|
2013-04-30 04:02:34 +08:00
|
|
|
% Blame: pesch@@cygnus.com, 28mar91.
|
2000-02-18 03:39:52 +08:00
|
|
|
@end tex
|
|
|
|
|
|
|
|
@contents
|
|
|
|
@bye
|
|
|
|
|
|
|
|
|