I am trying to validate float and double values using python. Since python supports large numbers, I would like to do validate the given number in within the range of float(32 bit floating point representation) or double(64 bit floating point representation)? How can I achieve it?
def is_int(x):
int_max_value = 2^31 - 1
int_min_value = -2^31
if int_min_value <= x <= int_max_value:
return True
else:
return False
def is_float(x):
# need to implement this
pass