#define acos(X) _Generic((X), \
long
double
complex: cacosl, \
double
complex: cacos, \
float
complex: cacosf, \
long
double
: acosl, \
float
: acosf, \
default
:
acos
\
)(X)
Also, need to remember that character constants are ints, and not char.
Also, __auto_type is pretty cool:
#define max(a,b) \
({ __auto_type _a = (a); \
__auto_type _b = (b); \
_a > _b ? _a : _b; })
Keine Kommentare:
Kommentar veröffentlichen