Page 916 Page 917
See Alsoperror(3) 21 July 1996 exitexitCauses normal program termination Synopsis#include <stdlib.h> void exit(int status); DescriptionThe exit() function causes normal program termination, and the value of status is returned to the parent. All functions registered with atexit() and on exit() are called in the reverse order of their registration, and all open streams are flushed and closed. Return ValueThe exit() function does not return. Conforms ToSVID 3, POSIX, BSD 4.3, ISO 9899 See Also_exit(2), atexit(3), on_exit(3) GNU, 2 April 1993 exp, log, log10, powexp, log, log10, powExponential, logarithmic, and power functions Synopsis#include <math.h> double exp(double x); Page 918 double log(double x); double log10(double x); double pow(double x, double y); DescriptionThe exp() function returns the value of e (the base of natural logarithms) raised to the power of x. The log() function returns the natural logarithm of x. The log10() function returns the base-10 logarithm of x. The pow() function returns the value of x raised to the power of y. ErrorsThe log() and log10() functions can return the following errors: EDOM The argument x is negative. ERANGE The argument x is 0. The log of 0 is not defined. The pow() function can return the following error: EDOM The argument x is negative and y is not an integral value. This would result in a complex number. CONFORMS TO SVID 3, POSIX, BSD 4.3, ISO 9899 SEE ALSO sqrt(3), cbrt(3) GNU June 16, 1993 expm1, log1pexpm1, log1pExponential minus 1, logarithm of 1 plus argument SYNOPSIS #include <math.h> double expm1 (double x); double log1p (double x); DESCRIPTION expm1(x) returns a value equivalent to exp (x)_1. It is computed in a way that is accurate even if the value of x is near 0a case where exp (x)_1 would be inaccurate due to subtraction of two numbers that are nearly equal. log1p(x) returns a value equivalent to log (1 + x). It is computed in a way that is accurate even if the value of x is near 0. CONFORMS TO BSD SEE ALSO exp(3), log(3) GNU, 16 September 1995 Page 919 fabsFabsAbsolute value of floating-point number SYNOPSIS #include <math.h> double fabs(double x); DESCRIPTION The fabs() function returns the absolute value of the floating-point number x. CONFORMS TO SVID 3, POSIX, BSD 4.3, ISO 9899 SEE ALSO abs(3), ceil(3), floor(3), labs(3), rint(3) 25 June 1993 fclosefcloseCloses a stream SYNOPSIS #include <stdio.h> int fclose(FILE *stream); DESCRIPTION The fclose function dissociates the named stream from its underlying file or set of functions. If the stream was being used for output, any buffered data is written first, using fflush(3). RETURN VALUES Upon successful completion, 0 is returned. Otherwise, EOF is returned, and the global variable errno is set to indicate the error. In either case, no further access to the stream is possible. ERRORS EBADF The argument stream is not an open stream. The fclose function may also fail and set errno for any of the errors specified for the routines close(2) or fflush(3). SEE ALSO close(2), fflush(3), fopen(3), setbuf(3) STANDARDS The fclose function conforms to ANSI C3.159-1989 ("ANSI C"). BSD Man Page, 29 November 1993 clearerr, feof, ferror, filenoclearerr, feof, ferror, filenoCheck and reset stream status Page 920 SYNOPSIS #include <stdio.h> void clearerr( FILE *stream); int feof(FILE *stream); int ferror(FILE *stream); int fileno(FILE *stream); DESCRIPTION The function clearerr clears the end-of-file and error indicators for the stream pointed to by stream. The function feof tests the end-of-file indicator for the stream pointed to by stream, returning nonzero if it is set. The end-of-file indicator can only be cleared by the function clearerr. The function ferror tests the error indicator for the stream pointed to by stream, returning nonzero if it is set. The error indicator can only be reset by the clearerr function. The function fileno examines the argument stream and returns its integer descriptor. ERRORS These functions should not fail and do not set the external variable errno. SEE ALSO open(2), stdio(3) STANDARDS The functions clearerr, feof, and ferror conform to C3.159-1989 ("ANSI C"). BSD Man Page, 29 November 1993 fflush, fpurgefflush, fpurgeFlush a stream SYNOPSIS #include <stdio.h> int fflush( FILE *stream); int fpurge( FILE *stream); DESCRIPTION The function fflush forces a write of all buffered data for the given output or update stream via the stream's underlying write function. The open status of the stream is unaffected. If the stream argument is NULL, fflush flushes all open output streams. (Does this happen under Linux?) The function fpurge erases any input or output buffered in the given stream. For output streams, this discards any unwritten output. For input streams, this discards any input read from the underlying object but not yet obtained via getc(3); this includes any text pushed back via ungetc. RETURN VALUES Upon successful completion, 0 is returned. Otherwise, EOF is returned, and the global variable errno is set to indicate the error. ERRORS EBADF Stream is not an open stream, or, in the case of fflush, not a stream open for writing. The function fflush may also fail and set errno for any of the errors specified for the routine write(2). |