If the numeric fits double boundaries, stores it into val and returns true, else returns false and fills val with NaN.
See Implementation