xref: /freebsd/lib/msun/man/cospi.3 (revision 8a271827e7b5d5310e06df1f9f49ba0ef9efd263)
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.\" $FreeBSD$
26.\"
27.Dd April 1, 2017
28.Dt COSPI 3
29.Os
30.Sh NAME
31.Nm cospi ,
32.Nm cospif ,
33.Nm cospil
34.Nd half\(encycle cosine functions
35.Sh LIBRARY
36.Lb libm
37.Sh SYNOPSIS
38.In math.h
39.Ft double
40.Fn cospi "double x"
41.Ft float
42.Fn cospif "float x"
43.Ft long double
44.Fn cospil "long double x"
45.Sh DESCRIPTION
46The
47.Fn cospi ,
48.Fn cospif ,
49and
50.Fn cospil
51functions compute the cosine of
52.Fa "\(*p \(mu x" .
53and measure angles in half-cycles.
54.Sh RETURN VALUES
55The
56.Fn cospi ,
57.Fn cospif ,
58and
59.Fn cospil
60functions returns
61.Fn cos "\(*p \(mu x" .
62If \*(Bax\*(Ba \*(Ge 2^(p - 1)
63where p is the floating\(enpoint precision of
64.Ar x ,
65then the returned value is 1 and it has no significance.
66.Sh SPECIAL VALUES
67.Bl -tag
68.It
69.Fn cospi \*(Pm0
70returns 1.
71.It
72.Fn cospi \*(Pmn/2
73returns 0 for positive integers
74.Ar n .
75.It
76.Fn cospi n
77returns 1 for even integers
78.Ar n .
79.It
80.Fn cospi n
81returns \-1 for odd integers
82.Ar n .
83.It
84.Fn cospi \*(Pm\(if
85return an \*(Na and raises an FE_INVALID exception.
86.It
87.Fn cospi \*(Na
88return an \*(Na and raises an FE_INVALID exception.
89.El
90.Sh SEE ALSO
91.Xr cos 3 ,
92.Xr fenv 3 ,
93.Xr math 3 ,
94.Xr sin 3 ,
95.Xr sinpi 3 ,
96.Xr tan 3 ,
97.Xr tanpi 3
98.Sh AUTHORS
99The half\(encycle trignometric functions were written by
100.An Steven G. Kargl Aq Mt kargl@FreeBSD.org .
101.Sh STANDARDS
102These functions conform to
103IEEE Std 754\(tm\(en2008 ,
104\(dqIEEE Standard for Floating-Point Arithmetic\(dq
105and to
106ISO/IEC TS 18661-4 ,
107\(dqInformation technology \(em Programming languages, their environments,
108and system software interfaces \(em Floating\(enpoint extensions for
109C\(dq \(em Part 4: Supplementary functions.
110
111
112