📄 0891-0896.html
字号:
<HTML>
<HEAD>
<TITLE>Linux Complete Command Reference:Part III:Library Functions :EarthWeb Inc.-</TITLE>
</HEAD>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!-- ISBN=0672311046 //-->
<!-- TITLE=Linux Complete Command Reference//-->
<!-- AUTHOR=Red Hat//-->
<!-- PUBLISHER=Macmillan Computer Publishing//-->
<!-- IMPRINT=Sams//-->
<!-- CHAPTER=03 //-->
<!-- PAGES=0891-1062 //-->
<!-- UNASSIGNED1 //-->
<!-- UNASSIGNED2 //-->
<P><CENTER>
<a href="../ch02/0888-0890.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0897-0901.html">Next</A></CENTER></P>
<A NAME="PAGENUM-891"><P>Page 891</P></A>
<H2>
Part III:
</H2>
<H3>
Library Functions
</H3>
<A NAME="PAGENUM-892"><P>Page 892</P></A>
<H3><A NAME="ch03_ 2">
Intro
</A></H3>
<P><B>DESCRIPTION</B>
</P>
<P>This chapter describes all the library functions, excluding the library functions described in Part 2, which implement
system calls. The various function groups are identified by a letter that is appended to the chapter number:
</P>
<TABLE>
<TR><TD>
(3C)
</TD><TD>
These functions—the functions from Chapter 2 and from Chapter 3S—are contained in the C
standard library libc, which will be used by cc(1) by default.
</TD></TR><TR><TD>
(3S)
</TD><TD>
These functions are parts of the stdio(3S) library. They are contained in the standard C library
libc.
</TD></TR><TR><TD>
(3M)
</TD><TD>
These functions are contained in the arithmetic library
libm. They are used by the f77(1) FORTRAN compiler by default, but not by the
cc(1) C compiler, which needs the option _lm.
</TD></TR><TR><TD>
(3F)
</TD><TD>
These functions are part of the FORTRAN library
libF77. There are no special compiler flags needed
to use these functions.
</TD></TR><TR><TD>
(3X)
</TD><TD>
Various special libraries. The manual pages documenting their functions specify the library names.
</TD></TR></TABLE>
<P><B>AUTHORS</B>
</P>
<P>Look at the header of the manual page for the author(s) and copyright conditions. Note that these can be different from
page to page!
</P>
<P>Linux, 13 December 1995
</P>
<H3><A NAME="ch03_ 3">
abort
</A></H3>
<!-- CODE SNIP //-->
<PRE>
abort—Causes abnormal program termination
</PRE>
<!-- END CODE SNIP //-->
<P><B>SYNOPSIS</B>
</P>
<!-- CODE SNIP //-->
<PRE>
#include <stdlib.h>
void abort(void);
</PRE>
<!-- END CODE SNIP //-->
<P><B>DESCRIPTION</B>
</P>
<P>The abort() function causes abnormal program termination unless the signal
SIGABORT is caught and the signal handler does not return. If the
abort() function causes program termination, all open streams are closed and flushed.
<P>If the SIGABORT function is blocked or ignored, the
abort() function will still override it.
</P>
<P><B>RETURN VALUE</B>
</P>
<P>The abort() function never returns.
</P>
<P><B>CONFORMS TO</B>
</P>
<P>SVID 3, POSIX, BSD 4.3, ISO 9899
</P>
<P></B>SEE ALSO</B>
</P>
<!-- CODE SNIP //-->
<PRE>
sigaction(2), exit(3)
</PRE>
<!-- END CODE SNIP //-->
<P>GNU, 12 April 1993
</P>
<H3><A NAME="ch03_ 4">
abs
</A></H3>
<P>abs—Computes the absolute value of an integer
</P>
<A NAME="PAGENUM-893"><P>Page 893</P></A>
<P><B>SYNOPSIS</B>
</P>
<!-- CODE SNIP //-->
<PRE>
#include <stdlib.h>
int abs(int j);
</PRE>
<!-- END CODE SNIP //-->
<P><B>DESCRIPTION</B>
</P>
<P>The abs() function computes the absolute value of the integer argument
j.
</P>
<P><B>RETURN VALUE</B>
</P>
<P>Returns the absolute value of the integer argument.
</P>
<P><B>CONFORMS TO</B>
</P>
<P>SVID 3, POSIX, BSD 4.3, ISO 9899
</P>
<P><B>NOTES</B>
</P>
<P>Trying to take the absolute value of the most negative integer is not defined.
</P>
<P></B>SEE ALSO</B>
</P>
<!-- CODE SNIP //-->
<PRE>
ceil(3), floor(3), fabs(3), labs(3), rint(3)
</PRE>
<!-- END CODE SNIP //-->
<P>GNU, 6 June 1993
</P>
<H3><A NAME="ch03_ 5">
acos
</A></H3>
<P>acos—Arc cosine function
</P>
<P><B>SYNOPSIS</B>
</P>
<!-- CODE SNIP //-->
<PRE WIDTH="1">
#include <math.h>
double acos(double x);
</PRE>
<!-- END CODE SNIP //-->
<P><B>DESCRIPTION</B>
</P>
<P>The acos() function calculates the arc cosine of
x; that is the value whose cosine is x. If x falls outside the range _1 to
1, acos() fails and errno is set.
</P>
<P><B>RETURN VALUE</B>
</P>
<P>The acos() function returns the arc cosine in radians; the value is mathematically defined to be between 0 and pi (inclusive).
</P>
<P><B>ERRORS</B>
</P>
<!-- CODE SNIP //-->
<PRE>
EDOM x is out of range.
</PRE>
<!-- END CODE SNIP //-->
<P><B>CONFORMS TO</B>
</P>
<P>SVID 3, POSIX, BSD 4.3, ISO 9899
</P>
<P></B>SEE ALSO</B>
</P>
<!-- CODE SNIP //-->
<PRE>
asin(3), atan(3), atan2(3), cos(3), sin(3), tan(3)
</PRE>
<!-- END CODE SNIP //-->
<P>
8 June 1993
</P>
<H3><A NAME="ch03_ 6">
acosh
</A></H3>
<!-- CODE SNIP //-->
<PRE>
acosh—Inverse hyperbolic cosine function
</PRE>
<!-- END CODE SNIP //-->
<A NAME="PAGENUM-894"><P>Page 894</P></A>
<P><B>SYNOPSIS</B>
</P>
<!-- CODE SNIP //-->
<PRE WIDTH="1">
#include <math.h>
double acosh(double x);
</PRE>
<!-- END CODE SNIP //-->
<P><B>DESCRIPTION</B>
</P>
<P>The acosh() function calculates the inverse hyperbolic cosine of
x; that is the value whose hyperbolic cosine is x. If
x is less than 1.0, acosh() returns not-a-number (NaN), and
errno is set.
</P>
<P><B>ERRORS</B>
</P>
<TABLE>
<TR><TD>
EDOM
</TD><TD>
x is out of range.
</TD></TR></TABLE>
<P><B>CONFORMS TO</B>
</P>
<P>SVID 3, POSIX, BSD 4.3, ISO 9899
</P>
<P></B>SEE ALSO</B>
</P>
<!-- CODE SNIP //-->
<PRE>
asinh(3), atanh(3), cosh(3), sinh(3), tanh(3)
</PRE>
<!-- END CODE SNIP //-->
<P>13 June 1993
</P>
<H3><A NAME="ch03_ 7">
alloca
</A></H3>
<P>alloca—Memory allocator
</P>
<P><B>SYNOPSIS</B>
</P>
<!-- CODE SNIP //-->
<PRE WIDTH="1">
#include <stdlib.h>
void *alloca( size_t size);
</PRE>
<!-- END CODE SNIP //-->
<P><B>DESCRIPTION</B>
</P>
<P>The alloca function allocates size bytes of space in the stack frame of the caller. This temporary space is automatically
freed on return.
</P>
<P><B>RETURN VALUES</B>
</P>
<P>The alloca function returns a pointer to the beginning of the allocated space. If the allocation fails, a
NULL pointer is returned.
</P>
<P><B>CONFORMS TO</B>
</P>
<P>There is evidence that the alloca function appeared in 32v, pwb, pwb.2, 3bsd, and 4bsd. There is a man page for it in
BSD 4.3. Linux uses the GNU version.
</P>
<P><B>BUGS</B>
</P>
<P>The alloca function is machine dependent.
</P>
<P></B>SEE ALSO</B>
</P>
<!-- CODE SNIP //-->
<PRE>
brk(2), pagesize(2), calloc(3), malloc(3),
realloc(3)
</PRE>
<!-- END CODE SNIP //-->
<P>GNU, 29 November 1993
</P>
<H3><A NAME="ch03_ 8">
asin
</A></H3>
<!-- CODE SNIP //-->
<PRE>
asin—Arc sine function
</PRE>
<!-- END CODE SNIP //-->
<A NAME="PAGENUM-895"><P>Page 895</P></A>
<P><B>SYNOPSIS</B>
</P>
<!-- CODE SNIP //-->
<PRE WIDTH="1">
#include <math.h>
double asin(double x);
</PRE>
<!-- END CODE SNIP //-->
<P><B>DESCRIPTION</B>
</P>
<P>The asin() function calculates the arc sine of
x, which is the value whose sine is x. If x falls outside the range _1 to 1,
asin() fails and errno is set.
</P>
<P><B>RETURN VALUE</B>
</P>
<P>The asin() function returns the arc sine in radians, and the value is mathematically defined to be between
-PI/2 and PI/2 (inclusive).
</P>
<P><B>ERRORS</B>
</P>
<TABLE>
<TR><TD>
EDOM
</TD><TD>
x is out of range.
</TD></TR></TABLE>
<P><B>CONFORMS TO</B>
</P>
<P>SVID 3, POSIX, BSD 4.3, ISO 9899
</P>
<P></B>SEE ALSO</B>
</P>
<!-- CODE SNIP //-->
<PRE>
acos(3), atan(3), atan2(3), cos(3), sin(3), tan(3)
</PRE>
<!-- END CODE SNIP //-->
<P>8 June 1993
</P>
<H3><A NAME="ch03_ 9">
asinh
</A></H3>
<P>asinh—Inverse hyperbolic sine function
</P>
<P><B>SYNOPSIS</B>
</P>
<!-- CODE SNIP //-->
<PRE WIDTH="1">
#include <math.h>
double asinh(double x);
</PRE>
<!-- END CODE SNIP //-->
<P><B>DESCRIPTION</B>
</P>
<P>The asinh() function calculates the inverse hyperbolic sine of
x—that is, the value whose hyperbolic sine is x.
</P>
<P><B>CONFORMS TO</B>
</P>
<P>SVID 3, POSIX, BSD 4.3, ISO 9899
</P>
<P></B>SEE ALSO</B>
</P>
<!-- CODE SNIP //-->
<PRE>
acosh(3), atanh(3), cosh(3), sinh(3), tanh(3)
</PRE>
<!-- END CODE SNIP //-->
<P>13 June 1993
</P>
<H3><A NAME="ch03_ 10">
assert
</A></H3>
<P>assert—Abort the program if assertion is false
</P>
<P><B>SYNOPSIS</B>
</P>
<!-- CODE SNIP //-->
<PRE WIDTH="1">
#include <assert.h>
void assert (int expression);
</PRE>
<!-- END CODE SNIP //-->
<A NAME="PAGENUM-896"><P>Page 896</P></A>
<P><B>DESCRIPTION</B>
</P>
<P>assert() prints an error message to standard output and terminates the program by calling
abort() if expression is false (that is, evaluates to
0). This only happens when the macro NDEBUG is undefined.
</P>
<P><B>RETURN VALUE</B>
</P>
<P>No value is returned.
</P>
<P><B>CONFORMS TO</B>
</P>
<P>ISO9899 (ANSI C)
</P>
<P><B>BUGS</B>
</P>
<P>assert() is implemented as a macro; if the expression tested has side effects, program behavior will be different depending
on whether NDEBUG is defined. This may create Heisenbugs, which go away when debugging is turned on.
</P>
<P></B>SEE ALSO</B>
</P>
<!-- CODE SNIP //-->
<PRE>
exit(3), abort(3)
</PRE>
<!-- END CODE SNIP //-->
<P>GNU, 4 April 1993
</P>
<H3><A NAME="ch03_ 11">
atan
</A></H3>
<P>atan—Arc tangent function
</P>
<P><B>SYNOPSIS</B>
</P>
<!-- CODE SNIP //-->
<PRE WIDTH="1">
#include <math.h>
double atan(double x);
</PRE>
<!-- END CODE SNIP //-->
<P><B>DESCRIPTION</B>
</P>
<P>The atan() function calculates the arc tangent of
x—that is, the value whose tangent is x.
</P>
<P><B>RETURN VALUE</B>
</P>
<P>The atan() function returns the arc tangent in radians, and the value is mathematically defined to be between
-PI/2 and PI/2 (inclusive).
</P>
<P><B>CONFORMS TO</B>
</P>
<P>SVID 3, POSIX, BSD 4.3, ISO 9899
</P>
<P></B>SEE ALSO</B>
</P>
<!-- CODE SNIP //-->
<PRE>
acos(3), asin(3), atan2(3), cos(3), sin(3), tan(3)
</PRE>
<!-- END CODE SNIP //-->
<P>8 June 1993
</P>
<H3><A NAME="ch03_ 12">
atan2
</A></H3>
<P>atan2—Arc tangent function of two variables
</P>
<P><B>SYNOPSIS</B>
</P>
<!-- CODE SNIP //-->
<PRE WIDTH="1">
#include <math.h>
double atan2(double y, double x);
</PRE>
<!-- END CODE SNIP //-->
<P><CENTER>
<a href="../ch02/0888-0890.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0897-0901.html">Next</A></CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -