1205bd648SDavid Schultz /*-
2*4d846d26SWarner Losh * SPDX-License-Identifier: BSD-2-Clause
35e53a4f9SPedro F. Giffuni *
4205bd648SDavid Schultz * Copyright (c) 2005 David Schultz <das@FreeBSD.ORG>
5205bd648SDavid Schultz * All rights reserved.
6205bd648SDavid Schultz *
7205bd648SDavid Schultz * Redistribution and use in source and binary forms, with or without
8205bd648SDavid Schultz * modification, are permitted provided that the following conditions
9205bd648SDavid Schultz * are met:
10205bd648SDavid Schultz * 1. Redistributions of source code must retain the above copyright
11205bd648SDavid Schultz * notice, this list of conditions and the following disclaimer.
12205bd648SDavid Schultz * 2. Redistributions in binary form must reproduce the above copyright
13205bd648SDavid Schultz * notice, this list of conditions and the following disclaimer in the
14205bd648SDavid Schultz * documentation and/or other materials provided with the distribution.
15205bd648SDavid Schultz *
16205bd648SDavid Schultz * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17205bd648SDavid Schultz * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18205bd648SDavid Schultz * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19205bd648SDavid Schultz * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20205bd648SDavid Schultz * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21205bd648SDavid Schultz * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22205bd648SDavid Schultz * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23205bd648SDavid Schultz * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24205bd648SDavid Schultz * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25205bd648SDavid Schultz * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26205bd648SDavid Schultz * SUCH DAMAGE.
27205bd648SDavid Schultz */
28205bd648SDavid Schultz
29205bd648SDavid Schultz #include <complex.h>
30205bd648SDavid Schultz #include <math.h>
31205bd648SDavid Schultz
32205bd648SDavid Schultz float
cargf(float complex z)33205bd648SDavid Schultz cargf(float complex z)
34205bd648SDavid Schultz {
35205bd648SDavid Schultz
36205bd648SDavid Schultz return (atan2f(cimagf(z), crealf(z)));
37205bd648SDavid Schultz }
38