Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Macro or function to construct a float (double) from a given sign, mantissa and exponent?

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)?

like image 703
mbaitoff Avatar asked Feb 03 '23 07:02

mbaitoff


1 Answers

The function you're looking for is ldexp.

like image 191
Raymond Chen Avatar answered Feb 06 '23 16:02

Raymond Chen