complex.h revision 1.3
1/* $OpenBSD: complex.h,v 1.3 2010/07/24 22:17:03 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 _COMPLEX_H_ 19#define _COMPLEX_H_ 20 21#include <sys/cdefs.h> 22 23/* 24 * C99 25 */ 26#ifdef __GNUC__ 27#if __STDC_VERSION__ < 199901 28#define _Complex __complex__ 29#endif 30#define _Complex_I 1.0fi 31#elif defined(lint) 32#define _Complex_I 1.0fi 33#endif 34 35#define complex _Complex 36 37/* XXX switch to _Imaginary_I */ 38#undef I 39#define I _Complex_I 40 41__BEGIN_DECLS 42/* 43 * Double versions of C99 functions 44 */ 45double complex cacos(double complex); 46double complex casin(double complex); 47double complex catan(double complex); 48double complex ccos(double complex); 49double complex csin(double complex); 50double complex ctan(double complex); 51double complex cacosh(double complex); 52double complex casinh(double complex); 53double complex catanh(double complex); 54double complex ccosh(double complex); 55double complex csinh(double complex); 56double complex ctanh(double complex); 57double complex cexp(double complex); 58double complex clog(double complex); 59double cabs(double complex); 60double complex cpow(double complex, double complex); 61double complex csqrt(double complex); 62double carg(double complex); 63double cimag(double complex); 64double complex conj(double complex); 65double complex cproj(double complex); 66double creal(double complex); 67 68/* 69 * Float versions of C99 functions 70 */ 71float complex cacosf(float complex); 72float complex casinf(float complex); 73float complex catanf(float complex); 74float complex ccosf(float complex); 75float complex csinf(float complex); 76float complex ctanf(float complex); 77float complex cacoshf(float complex); 78float complex casinhf(float complex); 79float complex catanhf(float complex); 80float complex ccoshf(float complex); 81float complex csinhf(float complex); 82float complex ctanhf(float complex); 83float complex cexpf(float complex); 84float complex clogf(float complex); 85float cabsf(float complex); 86float complex cpowf(float complex, float complex); 87float complex csqrtf(float complex); 88float cargf(float complex); 89float cimagf(float complex); 90float complex conjf(float complex); 91float complex cprojf(float complex); 92float crealf(float complex); 93 94/* 95 * Long double versions of C99 functions 96 */ 97#if 0 98long double complex cacosl(long double complex); 99long double complex casinl(long double complex); 100long double complex catanl(long double complex); 101long double complex ccosl(long double complex); 102long double complex csinl(long double complex); 103long double complex ctanl(long double complex); 104long double complex cacoshl(long double complex); 105long double complex casinhl(long double complex); 106long double complex catanhl(long double complex); 107long double complex ccoshl(long double complex); 108long double complex csinhl(long double complex); 109long double complex ctanhl(long double complex); 110long double complex cexpl(long double complex); 111long double complex clogl(long double complex); 112long double cabsl(long double complex); 113long double complex cpowl(long double complex, 114 long double complex); 115long double complex csqrtl(long double complex); 116long double cargl(long double complex); 117long double cimagl(long double complex); 118long double complex conjl(long double complex); 119long double complex cprojl(long double complex); 120long double creall(long double complex); 121#endif 122__END_DECLS 123 124#endif /* !_COMPLEX_H_ */ 125