-->
Page 897
DESCRIPTION
The atan2() function calculates the arc tangent of the two variables, x and y. It is similar to calculating the arc tangent of y/x, except that the sines of both arguments are used to determine the quadrant of the result.
RETURN VALUE
The atan2() function returns the result in radians, which is between -PI and PI (inclusive).
CONFORMS TO
SVID 3, POSIX, BSD 4.3, ISO 9899
SEE ALSO
acos(3), asin(3), atan(3), cos(3), sin(3), tan(3)
8 June 1993
atanhInverse hyperbolic tangent function
SYNOPSIS
#include <math.h> double atanh(double x);
DESCRIPTION
The atanh() function calculates the inverse hyperbolic tangent of x; that is the value whose hyperbolic tangent is x. If the absolute value of x is greater than 1.0, acosh() returns not-a-number (NaN), and errno is set.
ERRORS
EDOM | x is out of range. |
CONFORMS TO
SVID 3, POSIX, BSD 4.3, ISO 9899
SEE ALSO
asinh(3), acosh(3), cosh(3), sinh(3), tanh(3)
13 June 1993
atexitRegister a function to be called at normal program termination
SYNOPSIS
#include <stdlib.h> int atexit(void *function)(void));
DESCRIPTION
The atexit() function registers the given function to be called at normal program termination, whether via exit(2) or via return from the program's main. Functions so registered are called in the reverse order of their registration; no arguments are passed.
Page 898
RETURN VALUE
The atexit()function returns the value 0 if successful; otherwise, the value _1 is returned, and the global variable errno is set to indicate the error.
ERRORS
ENOMEM | Insufficient memory available to add the function. |
CONFORMS TO
SVID 3, BSD 4.3, ISO 9899
SEE ALSO
exit(3), on exit(3)
GNU, 29 March 1993
atofConvert a string to a double
SYNOPSIS
#include <stdlib.h> double atof(const char *nptr);
DESCRIPTION
The atof() function converts the initial portion of the string pointed to by nptr to double. The behavior is the same as
strtod(nptr, (char **)NULL);
except that atof() does not detect errors.
RETURN VALUE.
The converted value.
CONFORMS TO
SVID 3, POSIX, BSD 4.3, ISO 9899
SEE ALSO
atoi(3), atol(3), strtod(3), strtol(3), strtoul(3)
GNU, 29 March 1993
atoiConvert a string to an integer
SYNOPSIS
#include <stdlib.h> int atoi(const char *nptr);
Page 899
DESCRIPTION
The atoi() function converts the initial portion of the string pointed to by nptr to int. The behavior is the same as
strtol(nptr, (char **)NULL, 10);
except that atoi() does not detect errors.
RETURN VALUE
The converted value.
CONFORMS TO
SVID 3, POSIX, BSD 4.3, ISO 9899
SEE ALSO
atof(3), atol(3), strtod(3), strtol(3), strtoul(3)
GNU, 29 March 1993
atolConvert a string to a long integer
SYNOPSIS
#include <stdlib.h> long atol(const char *nptr);
DESCRIPTION
The atol() function converts the initial portion of the string pointed to by nptr to long. The behavior is the same as
strtol(nptr, (char **)NULL, 10);
except that atol() does not detect errors.
RETURN VALUE
The converted value.
CONFORMS TO
SVID 3, POSIX, BSD 4.3, ISO 9899
SEE ALSO
atof(3), atoi(3), strtod(3), strtol(3), strtoul(3)
GNU, 29 March 1993
bcmpCompare byte strings
SYNOPSIS
#include <string.h> int bcmp(const void *s1, const void *s2, int n);
Page 900
DESCRIPTION
The bcmp() function compares the first n bytes of the strings s1 and s2. If the two strings are equal, bcmp() returns 0; otherwise, it returns a nonzero result. If n is 0, the two strings are assumed to be equal.
RETURN VALUE
The bcmp() function returns 0 if the strings are equal; otherwise, a nonzero result is returned.
CONFORMS TO
4.3BSD. This function is deprecateduse memcmp in new programs.
SEE ALSO
memcmp(3), strcasecmp(3), strcmp(3), strcoll(3), strncmp(3), strncasecmp(3)
GNU, 9 April 1993
bcopyCopy byte strings
SYNOPSIS
#include <string.h> void bcopy (const void *src, void*dest, int n);
DESCRIPTION
The bcopy() function copies the first n bytes of the source string src to the destination string dest. If n is 0, no bytes are copied.
RETURN VALUE
The bcopy() function returns no value.
CONFORMS TO
4.3BSD. This function is deprecateduse memcpy in new programs.
SEE ALSO
memccpy(3), memcpy(3), memmove(3), strcpy(3), strncpy(3)
GNU, 9 April 1993
bsearchBinary search of a sorted array.
SYNOPSIS
#include <stdlib.h> void *bsearch(const void *key, const void *base, size_t nmemb, size_t size,int(*compar)(const void *, const void *));
DESCRIPTION
The bsearch() function searches an array of nmemb objects, the initial member of which is pointed to by base, for a member that matches the object pointed to by key. The size of each member of the array is specified by size.
The contents of the array should be in ascending sorted order according to the comparison function referenced by compar.
Page 901
The compar routine is expected to have two arguments that point to the key object and to an array member, in that order, and should return an integer less than, equal to, or greater than 0, respectively, if the key object is found to be less than, match, or be greater than the array member.
RETURN VALUE
The bsearch() function returns a pointer to a matching member of the array, or NULL if no match is found. If there are multiple elements that match the key, the element returned is unspecified.
CONFORMS TO
SVID 3, BSD 4.3, ISO 9899
SEE ALSO
qsort(3)
GNU, 29 March 1993
bcmp, bcopy, bzero, memccpy, memchr, memcmp, memcpy, memfrob, memmem, memmove, memsetByte string operations
SYNOPSIS
#include <string.h> int bcmp(const void *s1, const void *s2, int n); void bcopy(const void *src, void *dest, int n); void bzero(void *s, int n); void *memccpy(void *dest, const void *src, int c, size_t n); void *memchr(const void *s, int c, size_t n); int memcmp(const void *s1, const void *s2, size_t n); void *memcpy(void *dest, const void *src, size_t n); void *memfrob(void *s, size_t n); void *memmem(const void *needle, size_t needlelen, const void *haystack, size_t haystacklen); void *memmove(void *dest, const void *src, size_t n); void *memset(void *s, int c, size_t n);
DESCRIPTION
The byte string functions perform operations on strings that are not NULL terminated. See the individual man pages for descriptions of each function.
SEE ALSO
bcmp(3), bcopy(3), bzero(3), memccpy(3), memchr(3), memcmp(3), memcpy(3), memfrob(3), memmem(3), memmove(3), memset(3)
GNU, 12 April 1993
htonl, htons, ntohl, ntohsConvert values between host and network byte order
SYNOPSIS
#include <netinet/in.h> unsigned long int htonl(unsigned long int hostlong); unsigned short int htons(unsigned short int hostshort);