xref: /freebsd/lib/msun/man/cospi.3 (revision f5463265955b829775bbb32e1fd0bc11dafc36ce)
1.\" Copyright (c) 2017 Steven G. Kargl <kargl@FreeBSD.org>
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.Dd April 1, 2017
26.Dt COSPI 3
27.Os
28.Sh NAME
29.Nm cospi ,
30.Nm cospif ,
31.Nm cospil
32.Nd half\(encycle cosine functions
33.Sh LIBRARY
34.Lb libm
35.Sh SYNOPSIS
36.In math.h
37.Ft double
38.Fn cospi "double x"
39.Ft float
40.Fn cospif "float x"
41.Ft long double
42.Fn cospil "long double x"
43.Sh DESCRIPTION
44The
45.Fn cospi ,
46.Fn cospif ,
47and
48.Fn cospil
49functions compute the cosine of
50.Fa "\(*p \(mu x" .
51and measure angles in half-cycles.
52.Sh RETURN VALUES
53The
54.Fn cospi ,
55.Fn cospif ,
56and
57.Fn cospil
58functions returns
59.Fn cos "\(*p \(mu x" .
60If \*(Bax\*(Ba \*(Ge 2^(p - 1)
61where p is the floating\(enpoint precision of
62.Ar x ,
63then the returned value is 1 and it has no significance.
64.Sh SPECIAL VALUES
65.Bl -tag
66.It
67.Fn cospi \*(Pm0
68returns 1.
69.It
70.Fn cospi \*(Pmn/2
71returns 0 for positive integers
72.Ar n .
73.It
74.Fn cospi n
75returns 1 for even integers
76.Ar n .
77.It
78.Fn cospi n
79returns \-1 for odd integers
80.Ar n .
81.It
82.Fn cospi \*(Pm\(if
83return an \*(Na and raises an FE_INVALID exception.
84.It
85.Fn cospi \*(Na
86return an \*(Na and raises an FE_INVALID exception.
87.El
88.Sh SEE ALSO
89.Xr cos 3 ,
90.Xr fenv 3 ,
91.Xr math 3 ,
92.Xr sin 3 ,
93.Xr sinpi 3 ,
94.Xr tan 3 ,
95.Xr tanpi 3
96.Sh AUTHORS
97The half\(encycle trignometric functions were written by
98.An Steven G. Kargl Aq Mt kargl@FreeBSD.org .
99.Sh STANDARDS
100These functions conform to
101IEEE Std 754\(tm\(en2008 ,
102\(dqIEEE Standard for Floating-Point Arithmetic\(dq
103and to
104ISO/IEC TS 18661-4 ,
105\(dqInformation technology \(em Programming languages, their environments,
106and system software interfaces \(em Floating\(enpoint extensions for
107C\(dq \(em Part 4: Supplementary functions.
108
109
110