What I'm trying to do would look like this in Python
(where n
is float/double):
def check_int(n):
if not isinstance(n, numbers.Integral):
raise TypeError()
Since C/C++ are typestrong, what kind of cast-and-compare magic would be the best for this purpose?
I'd preferably want to know how it's done in C.