On Thu, 19 Oct 2006 11:55:55 -0400, Bo Peng < XXXX@XXXXX.COM > wrote in
You've received a lot of answers containing guesses. The C++ standard
inherits <float.h> (or <cfloat>) from C, and it defines macros
FLT_DIG, DBL_DIG, and LDBL_DIG that provide the guarantees you are
asking for for the three floating point types.
Since the minimum value for FLT_DIG is 6, and the minimum for the
others is 10, any integer value in the range of +/- 9,999,999,999,999
may be stored in a float and later back into a (wide enough) integer
type and yield the exact value.