xref: /openbsd/include/complex.h (revision acf82b0a)
1*acf82b0aSguenther /*	$OpenBSD: complex.h,v 1.5 2014/03/16 18:38:30 guenther Exp $	*/
27b36286aSmartynas /*
37b36286aSmartynas  * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
47b36286aSmartynas  *
57b36286aSmartynas  * Permission to use, copy, modify, and distribute this software for any
67b36286aSmartynas  * purpose with or without fee is hereby granted, provided that the above
77b36286aSmartynas  * copyright notice and this permission notice appear in all copies.
87b36286aSmartynas  *
97b36286aSmartynas  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
107b36286aSmartynas  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
117b36286aSmartynas  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
127b36286aSmartynas  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
137b36286aSmartynas  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
147b36286aSmartynas  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
157b36286aSmartynas  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
167b36286aSmartynas  */
177b36286aSmartynas 
187b36286aSmartynas #ifndef _COMPLEX_H_
197b36286aSmartynas #define	_COMPLEX_H_
207b36286aSmartynas 
217b36286aSmartynas #include <sys/cdefs.h>
227b36286aSmartynas 
237b36286aSmartynas /*
247b36286aSmartynas  * C99
257b36286aSmartynas  */
267b36286aSmartynas #ifdef __GNUC__
277b36286aSmartynas #if __STDC_VERSION__ < 199901
287b36286aSmartynas #define _Complex	__complex__
297b36286aSmartynas #endif
307b36286aSmartynas #define _Complex_I	1.0fi
317b36286aSmartynas #endif
327b36286aSmartynas 
337b36286aSmartynas #define complex		_Complex
347b36286aSmartynas 
357b36286aSmartynas /* XXX switch to _Imaginary_I */
367b36286aSmartynas #undef I
377b36286aSmartynas #define I		_Complex_I
387b36286aSmartynas 
397b36286aSmartynas __BEGIN_DECLS
407b36286aSmartynas /*
417b36286aSmartynas  * Double versions of C99 functions
427b36286aSmartynas  */
437b36286aSmartynas double complex cacos(double complex);
447b36286aSmartynas double complex casin(double complex);
457b36286aSmartynas double complex catan(double complex);
467b36286aSmartynas double complex ccos(double complex);
477b36286aSmartynas double complex csin(double complex);
487b36286aSmartynas double complex ctan(double complex);
497b36286aSmartynas double complex cacosh(double complex);
507b36286aSmartynas double complex casinh(double complex);
517b36286aSmartynas double complex catanh(double complex);
527b36286aSmartynas double complex ccosh(double complex);
537b36286aSmartynas double complex csinh(double complex);
547b36286aSmartynas double complex ctanh(double complex);
557b36286aSmartynas double complex cexp(double complex);
567b36286aSmartynas double complex clog(double complex);
577b36286aSmartynas double cabs(double complex);
587b36286aSmartynas double complex cpow(double complex, double complex);
597b36286aSmartynas double complex csqrt(double complex);
607b36286aSmartynas double carg(double complex);
617b36286aSmartynas double cimag(double complex);
627b36286aSmartynas double complex conj(double complex);
637b36286aSmartynas double complex cproj(double complex);
647b36286aSmartynas double creal(double complex);
657b36286aSmartynas 
667b36286aSmartynas /*
677b36286aSmartynas  * Float versions of C99 functions
687b36286aSmartynas  */
697b36286aSmartynas float complex cacosf(float complex);
707b36286aSmartynas float complex casinf(float complex);
717b36286aSmartynas float complex catanf(float complex);
727b36286aSmartynas float complex ccosf(float complex);
737b36286aSmartynas float complex csinf(float complex);
747b36286aSmartynas float complex ctanf(float complex);
757b36286aSmartynas float complex cacoshf(float complex);
767b36286aSmartynas float complex casinhf(float complex);
777b36286aSmartynas float complex catanhf(float complex);
787b36286aSmartynas float complex ccoshf(float complex);
797b36286aSmartynas float complex csinhf(float complex);
807b36286aSmartynas float complex ctanhf(float complex);
817b36286aSmartynas float complex cexpf(float complex);
827b36286aSmartynas float complex clogf(float complex);
837b36286aSmartynas float cabsf(float complex);
847b36286aSmartynas float complex cpowf(float complex, float complex);
857b36286aSmartynas float complex csqrtf(float complex);
867b36286aSmartynas float cargf(float complex);
877b36286aSmartynas float cimagf(float complex);
887b36286aSmartynas float complex conjf(float complex);
897b36286aSmartynas float complex cprojf(float complex);
907b36286aSmartynas float crealf(float complex);
917b36286aSmartynas 
927b36286aSmartynas /*
937b36286aSmartynas  * Long double versions of C99 functions
947b36286aSmartynas  */
957b36286aSmartynas long double complex cacosl(long double complex);
967b36286aSmartynas long double complex casinl(long double complex);
977b36286aSmartynas long double complex catanl(long double complex);
987b36286aSmartynas long double complex ccosl(long double complex);
997b36286aSmartynas long double complex csinl(long double complex);
1007b36286aSmartynas long double complex ctanl(long double complex);
1017b36286aSmartynas long double complex cacoshl(long double complex);
1027b36286aSmartynas long double complex casinhl(long double complex);
1037b36286aSmartynas long double complex catanhl(long double complex);
1047b36286aSmartynas long double complex ccoshl(long double complex);
1057b36286aSmartynas long double complex csinhl(long double complex);
1067b36286aSmartynas long double complex ctanhl(long double complex);
1077b36286aSmartynas long double complex cexpl(long double complex);
1087b36286aSmartynas long double complex clogl(long double complex);
1097b36286aSmartynas long double cabsl(long double complex);
1107b36286aSmartynas long double complex cpowl(long double complex,
1117b36286aSmartynas 	long double complex);
1127b36286aSmartynas long double complex csqrtl(long double complex);
1137b36286aSmartynas long double cargl(long double complex);
1147b36286aSmartynas long double cimagl(long double complex);
1157b36286aSmartynas long double complex conjl(long double complex);
1167b36286aSmartynas long double complex cprojl(long double complex);
1177b36286aSmartynas long double creall(long double complex);
1187b36286aSmartynas __END_DECLS
1197b36286aSmartynas 
120a0599817Sray #endif /* !_COMPLEX_H_ */
121