COS(3) Linux Programmer's Manual COS(3)NAME
cos, cosf, cosl - cosine function
SYNOPSIS
#include <math.h>
double cos(double x);
float cosf(float x);
long double cosl(long double x);
Link with -lm.
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
cosf(), cosl():
_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L;
or cc -std=c99
DESCRIPTION
The cos() function returns the cosine of x, where x is given in radians.
RETURN VALUE
On success, these functions return the cosine of x.
If x is a NaN, a NaN is returned.
If x is positive infinity or negative infinity, a domain error occurs, and a NaN is returned.
ERRORS
See math_error(7) for information on how to determine whether an error has occurred when calling these functions.
The following errors can occur:
Domain error: x is an infinity
errno is set to EDOM (but see BUGS). An invalid floating-point exception (FE_INVALID) is raised.
CONFORMING TO
C99, POSIX.1-2001. The variant returning double also conforms to SVr4, 4.3BSD.
BUGS
Before version 2.10, the glibc implementation did not set errno to EDOM when a domain error occurred.
SEE ALSO acos(3), asin(3), atan(3), atan2(3), ccos(3), sin(3), sincos(3), tan(3)COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
2010-09-11 COS(3)
Check Out this Related Man Page
COS(3) Linux Programmer's Manual COS(3)NAME
cos, cosf, cosl - cosine function
SYNOPSIS
#include <math.h>
double cos(double x);
float cosf(float x);
long double cosl(long double x);
Link with -lm.
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
cosf(), cosl():
_ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
|| /* Since glibc 2.19: */ _DEFAULT_SOURCE
|| /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
DESCRIPTION
These functions return the cosine of x, where x is given in radians.
RETURN VALUE
On success, these functions return the cosine of x.
If x is a NaN, a NaN is returned.
If x is positive infinity or negative infinity, a domain error occurs, and a NaN is returned.
ERRORS
See math_error(7) for information on how to determine whether an error has occurred when calling these functions.
The following errors can occur:
Domain error: x is an infinity
errno is set to EDOM (but see BUGS). An invalid floating-point exception (FE_INVALID) is raised.
ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).
+----------------------+---------------+---------+
|Interface | Attribute | Value |
+----------------------+---------------+---------+
|cos(), cosf(), cosl() | Thread safety | MT-Safe |
+----------------------+---------------+---------+
CONFORMING TO
C99, POSIX.1-2001, POSIX.1-2008.
The variant returning double also conforms to SVr4, 4.3BSD.
BUGS
Before version 2.10, the glibc implementation did not set errno to EDOM when a domain error occurred.
SEE ALSO acos(3), asin(3), atan(3), atan2(3), ccos(3), sin(3), sincos(3), tan(3)COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the
latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.
2017-09-15 COS(3)
Hi,
I have written a c program to find cos() of a value , its not working, I am getting value of "val " as 0000.
#include<stdio.h>
#include<math.h>
main()
{
float val;
val = cosf( 1.570796);
printf("\nval = %f",val);
} (9 Replies)
I need to use sort, uniq, grep, wc,... and the like to work with lists of words in UTF-8 (the "words" being phonetic transcriptions using the IPA). I have been using Google a lot and I even found at least one previous post on this topic, but it didn't help.
I tried following the instructions... (2 Replies)
Greetings all,
If I have a SH script that calls a PERL script in the following way:
perl $HOME/scripts/config.properties
And in the config.properties PERL file, this Perl script only sets a number of environmental parameters in the following way:
#!/usr/bin/perl
$VAR1 = (
... (3 Replies)
The below awk will filter a list of 30,000 lines in the tab-delimited file. What I am having trouble with is adding a condition to SVTYPE=CNV
that will only print that line if CI= must be >.05 .
The other condition to add is if SVTYPE=Fusion, then in order to print that line
READ_COUNT must... (3 Replies)
I am starting to write a multi-line awk and using the file below which is
tab-delimited, print only the line with oncomineGeneClass
and oncomineVariantClass and PASS. The script execute but
seems to be printing the entire file, not the desired line. Thank you :).
file
... (8 Replies)
In the awk below, what I am attempting to do is check each line in the tab-delimeted input, which has ~20 lines in it, for a keyword
SVTYPE=Fusion. If the keyword is found I am splitting $3 using the . (dot) and reading the portion before and after the dot in an array a.
If it does have that... (12 Replies)