tgmath.h(7POSIX) | POSIX Programmer's Manual | tgmath.h(7POSIX) |

#include <tgmath.h>

- *
- First, if any argument for generic parameters has type
**long double**, the type determined is**long double**.

- *
- Otherwise, if any argument for generic parameters has type
**double**or is of integer type, the type determined is**double**.

- *
- Otherwise, the type determined is
**float**.

<math.h> Function | <complex.h> Function | Type-Generic Macro |

acos() |
cacos() |
acos() |

asin() |
casin() |
asin() |

atan() |
catan() |
atan() |

acosh() |
cacosh() |
acosh() |

asinh() |
casinh() |
asinh() |

atanh() |
catanh() |
atanh() |

cos() |
ccos() |
cos() |

sin() |
csin() |
sin() |

tan() |
ctan() |
tan() |

cosh() |
ccosh() |
cosh() |

sinh() |
csinh() |
sinh() |

tanh() |
ctanh() |
tanh() |

exp() |
cexp() |
exp() |

log() |
clog() |
log() |

pow() |
cpow() |
pow() |

sqrt() |
csqrt() |
sqrt() |

fabs() |
cabs() |
fabs() |

atan2() cbrt() ceil() copysign()
erf() erfc() exp2() expm1() fdim()
floor() |
fma() fmax() fmin() fmod() frexp()
hypot() ilogb() ldexp() lgamma()
llrint() |
llround() log10() log1p() log2()
logb() lrint() lround() nearbyint()
nextafter() nexttoward() |
remainder() remquo() rint() round()
scalbln() scalbn() tgamma() trunc() |

#include <tgmath.h>int n;float f;double d;long double ld;float complex fc;double complex dc;long double complex ldc;

Macro | Use Invokes |

exp(n) |
exp(n), the function |

acosh(f) |
acoshf(f) |

sin(d) |
sin(d), the function |

atan(ld) |
atanl(ld) |

log(fc) |
clogf(fc) |

sqrt(dc) |
csqrt(dc) |

pow(ldc,f) |
cpowl(ldc, f) |

remainder(n,n) |
remainder(n, n), the function |

nextafter(d,f) |
nextafter(d, f), the function |

nexttoward(f,ld) |
nexttowardf(f, ld) |

copysign(n,ld) |
copysignl(n, ld) |

ceil(fc) |
Undefined behavior |

rint(dc) |
Undefined behavior |

fmax(ldc,ld) |
Undefined behavior |

carg(n) |
carg(n), the function |

cproj(f) |
cprojf(f) |

creal(d) |
creal(d), the function |

cimag(ld) |
cimagl(ld) |

cabs(fc) |
cabsf(fc) |

carg(dc) |
carg(dc), the function |

cproj(ldc) |
cprojl(ldc) |

printf ("%e", sin(x))

#undef sqrt#define sqrt(x) __BUILTIN_GENERIC_sqrt(x)

2013 | IEEE/The Open Group |