问题
Is there any macro or function to construct a float (double) from a given sign, mantissa and exponent (all binary or decimal) that either returns a valid float (double) number or returns NaN if the number specified by input is not representable as float (double)?
回答1:
The function you're looking for is ldexp.
来源:https://stackoverflow.com/questions/9639375/macro-or-function-to-construct-a-float-double-from-a-given-sign-mantissa-and