Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

cosf(3) [linux 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(): _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

ACOS(3) 						     Linux Programmer's Manual							   ACOS(3)

NAME
acos, acosf, acosl - arc cosine function SYNOPSIS
#include <math.h> double acos(double x); float acosf(float x); long double acosl(long double x); Link with -lm. Feature Test Macro Requirements for glibc (see feature_test_macros(7)): acosf(), acosl(): _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || /* Since glibc 2.19: */ _DEFAULT_SOURCE || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE DESCRIPTION
These functions calculate the arc cosine of x; that is the value whose cosine is x. RETURN VALUE
On success, these functions return the arc cosine of x in radians; the return value is in the range [0, pi]. If x is a NaN, a NaN is returned. If x is +1, +0 is returned. If x is positive infinity or negative infinity, a domain error occurs, and a NaN is returned. If x is outside the range [-1, 1], 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 outside the range [-1, 1] errno is set to EDOM. 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 | +-------------------------+---------------+---------+ |acos(), acosf(), acosl() | Thread safety | MT-Safe | +-------------------------+---------------+---------+ CONFORMING TO
C99, POSIX.1-2001, POSIX.1-2008. The variant returning double also conforms to SVr4, 4.3BSD, C89. SEE ALSO
asin(3), atan(3), atan2(3), cacos(3), cos(3), sin(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 ACOS(3)
Man Page

7 More Discussions You Might Find Interesting

1. Programming

cos() command not working in Linux

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)
Discussion started by: shashi
9 Replies

2. UNIX for Dummies Questions & Answers

UTF-8 in xterm

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)
Discussion started by: mregine
2 Replies

3. Shell Programming and Scripting

Passing PERL var values to SH Shell Script

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)
Discussion started by: gikyo12
3 Replies

4. IP Networking

Help with iptables

photo... (1 Reply)
Discussion started by: beerpong1
1 Replies

5. Shell Programming and Scripting

awk to filter file based on seperate conditions

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)
Discussion started by: cmccabe
3 Replies

6. Shell Programming and Scripting

awk to print line based on two keywords

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)
Discussion started by: cmccabe
8 Replies

7. Shell Programming and Scripting

awk to combine lines if fields match in lines

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)
Discussion started by: cmccabe
12 Replies