#define UNION_CAST(x, destType) \
(((union {__typeof__(x) a; destType b;})x).b)
You can then use
int myInt = UNION_CAST(myFloat, int);
Credit: cocoawithlove
#define UNION_CAST(x, destType) \
(((union {__typeof__(x) a; destType b;})x).b)
You can then use
int myInt = UNION_CAST(myFloat, int);
Credit: cocoawithlove