Skip to content

Commit d8c909a

Browse files
committed
Add all the complex declarations to openlibm.h.
1 parent b7da33c commit d8c909a

2 files changed

Lines changed: 106 additions & 1 deletion

File tree

src/openlibm.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ extern const union __nan_un {
102102
((sizeof (x) == sizeof (float)) ? __fpclassifyf(x) \
103103
: (sizeof (x) == sizeof (double)) ? __fpclassifyd(x) \
104104
: __fpclassifyl(x))
105-
105+
106106
#define isfinite(x) \
107107
((sizeof (x) == sizeof (float)) ? __isfinitef(x) \
108108
: (sizeof (x) == sizeof (double)) ? __isfinite(x) \
@@ -584,6 +584,9 @@ long double tgammal(long double);
584584
long double truncl(long double);
585585

586586
#endif /* __ISO_C_VISIBLE >= 1999 */
587+
588+
#include "openlibm_complex.h"
589+
587590
#if defined(__cplusplus)
588591
}
589592
#endif

src/openlibm_complex.h

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
/* $OpenBSD: complex.h,v 1.5 2014/03/16 18:38:30 guenther Exp $ */
2+
/*
3+
* Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
4+
*
5+
* Permission to use, copy, modify, and distribute this software for any
6+
* purpose with or without fee is hereby granted, provided that the above
7+
* copyright notice and this permission notice appear in all copies.
8+
*
9+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16+
*/
17+
18+
#ifndef _OPENLIBM_COMPLEX_H_
19+
#define _OPENLIBM_COMPLEX_H_
20+
21+
#include <sys/cdefs.h>
22+
23+
/*
24+
* Double versions of C99 functions
25+
*/
26+
double complex cacos(double complex);
27+
double complex casin(double complex);
28+
double complex catan(double complex);
29+
double complex ccos(double complex);
30+
double complex csin(double complex);
31+
double complex ctan(double complex);
32+
double complex cacosh(double complex);
33+
double complex casinh(double complex);
34+
double complex catanh(double complex);
35+
double complex ccosh(double complex);
36+
double complex csinh(double complex);
37+
double complex ctanh(double complex);
38+
double complex cexp(double complex);
39+
double complex clog(double complex);
40+
double cabs(double complex);
41+
double complex cpow(double complex, double complex);
42+
double complex csqrt(double complex);
43+
double carg(double complex);
44+
double cimag(double complex);
45+
double complex conj(double complex);
46+
double complex cproj(double complex);
47+
double creal(double complex);
48+
49+
/*
50+
* Float versions of C99 functions
51+
*/
52+
float complex cacosf(float complex);
53+
float complex casinf(float complex);
54+
float complex catanf(float complex);
55+
float complex ccosf(float complex);
56+
float complex csinf(float complex);
57+
float complex ctanf(float complex);
58+
float complex cacoshf(float complex);
59+
float complex casinhf(float complex);
60+
float complex catanhf(float complex);
61+
float complex ccoshf(float complex);
62+
float complex csinhf(float complex);
63+
float complex ctanhf(float complex);
64+
float complex cexpf(float complex);
65+
float complex clogf(float complex);
66+
float cabsf(float complex);
67+
float complex cpowf(float complex, float complex);
68+
float complex csqrtf(float complex);
69+
float cargf(float complex);
70+
float cimagf(float complex);
71+
float complex conjf(float complex);
72+
float complex cprojf(float complex);
73+
float crealf(float complex);
74+
75+
/*
76+
* Long double versions of C99 functions
77+
*/
78+
long double complex cacosl(long double complex);
79+
long double complex casinl(long double complex);
80+
long double complex catanl(long double complex);
81+
long double complex ccosl(long double complex);
82+
long double complex csinl(long double complex);
83+
long double complex ctanl(long double complex);
84+
long double complex cacoshl(long double complex);
85+
long double complex casinhl(long double complex);
86+
long double complex catanhl(long double complex);
87+
long double complex ccoshl(long double complex);
88+
long double complex csinhl(long double complex);
89+
long double complex ctanhl(long double complex);
90+
long double complex cexpl(long double complex);
91+
long double complex clogl(long double complex);
92+
long double cabsl(long double complex);
93+
long double complex cpowl(long double complex,
94+
long double complex);
95+
long double complex csqrtl(long double complex);
96+
long double cargl(long double complex);
97+
long double cimagl(long double complex);
98+
long double complex conjl(long double complex);
99+
long double complex cprojl(long double complex);
100+
long double creall(long double complex);
101+
102+
#endif /* !_OPENLIBM_COMPLEX_H_ */

0 commit comments

Comments
 (0)