1 #define _GNU_SOURCE 2 #include <stdio.h> 3 #include <math.h> 4 #include <complex.h> 5 #include <stdlib.h> 6 7 double complex c1, c2; 8 float complex f1, f2; 9 #ifdef _HAVE_LONG_DOUBLE 10 long double complex l1, l2; 11 #endif 12 13 /* 14 * Touch test to make sure all of the expected complex functions exist 15 */ 16 17 int main(void)18main(void) 19 { 20 /* 7.3.5 Trigonometric functions */ 21 /* 7.3.5.1 The cacos functions */ 22 (void) cacos(c1); 23 (void) cacosf(f1); 24 25 /* 7.3.5.2 The casin functions */ 26 (void) casin(c1); 27 (void) casinf(f1); 28 #ifdef _LDBL_EQ_DBL 29 (void) casinl(l1); 30 #endif 31 32 /* 7.3.5.1 The catan functions */ 33 (void) catan(c1); 34 (void) catanf(f1); 35 #ifdef _LDBL_EQ_DBL 36 (void) catanl(l1); 37 #endif 38 39 /* 7.3.5.1 The ccos functions */ 40 (void) ccos(c1); 41 (void) ccosf(f1); 42 43 /* 7.3.5.1 The csin functions */ 44 (void) csin(c1); 45 (void) csinf(f1); 46 47 /* 7.3.5.1 The ctan functions */ 48 (void) ctan(c1); 49 (void) ctanf(f1); 50 51 /* 7.3.6 Hyperbolic functions */ 52 /* 7.3.6.1 The cacosh functions */ 53 (void) cacosh(c1); 54 (void) cacoshf(f1); 55 56 /* 7.3.6.2 The casinh functions */ 57 (void) casinh(c1); 58 (void) casinhf(f1); 59 60 /* 7.3.6.3 The catanh functions */ 61 (void) catanh(c1); 62 (void) catanhf(f1); 63 64 /* 7.3.6.4 The ccosh functions */ 65 (void) ccosh(c1); 66 (void) ccoshf(f1); 67 68 /* 7.3.6.5 The csinh functions */ 69 (void) csinh(c1); 70 (void) csinhf(f1); 71 72 /* 7.3.6.6 The ctanh functions */ 73 (void) ctanh(c1); 74 (void) ctanhf(f1); 75 76 /* 7.3.7 Exponential and logarithmic functions */ 77 /* 7.3.7.1 The cexp functions */ 78 (void) cexp(c1); 79 (void) cexpf(f1); 80 81 /* 7.3.7.2 The clog functions */ 82 (void) clog(c1); 83 (void) clogf(f1); 84 #ifdef _LDBL_EQ_DBL 85 (void) clogl(l1); 86 #endif 87 88 /* 7.3.8 Power and absolute-value functions */ 89 /* 7.3.8.1 The cabs functions */ 90 /*#ifndef __LIBM0_SOURCE__ */ 91 /* avoid conflict with historical cabs(struct complex) */ 92 /* double cabs(c1) __RENAME(__c99_cabs); 93 float cabsf(f1) __RENAME(__c99_cabsf); 94 #endif 95 */ 96 (void) cabsl(l1) ; 97 (void) cabs(c1) ; 98 (void) cabsf(f1) ; 99 100 /* 7.3.8.2 The cpow functions */ 101 (void) cpow(c1, c2); 102 (void) cpowf(f1, f2); 103 104 /* 7.3.8.3 The csqrt functions */ 105 (void) csqrt(c1); 106 (void) csqrtf(f1); 107 (void) csqrtl(l1); 108 109 /* 7.3.9 Manipulation functions */ 110 /* 7.3.9.1 The carg functions */ 111 (void) carg(c1); 112 (void) cargf(f1); 113 #ifdef _LDBL_EQ_DBL 114 (void) cargl(l1); 115 #endif 116 117 /* 7.3.9.2 The cimag functions */ 118 (void) cimag(c1); 119 (void) cimagf(f1); 120 (void) cimagl(l1); 121 122 /* 7.3.9.3 The conj functions */ 123 (void) conj(c1); 124 (void) conjf(f1); 125 126 /* 7.3.9.4 The cproj functions */ 127 (void) cproj(c1); 128 (void) cprojf(f1); 129 130 /* 7.3.9.5 The creal functions */ 131 (void) creal(c1); 132 (void) crealf(f1); 133 (void) creall(l1); 134 135 (void) clog10(c1); 136 (void) clog10f(f1); 137 138 #ifdef _LDBL_EQ_DBL 139 (void) cacosl(l1); 140 (void) ccosl(l1); 141 (void) csinl(l1); 142 (void) ctanl(l1); 143 (void) cacoshl(l1); 144 (void) casinhl(l1); 145 (void) catanhl(l1); 146 (void) ccoshl(l1); 147 (void) csinhl(l1); 148 (void) ctanhl(l1); 149 (void) cexpl(l1); 150 (void) cpowl(l1, l2); 151 #endif 152 (void) conjl(l1); 153 (void) cprojl(l1); 154 155 return 0; 156 } 157