I've got some numbers and I'm trying to determine if rounding will occur if I store them as the type float. The numbers have six digits( e.g. 1.23456e001). How can I determine the number of significant digits that are stored in a float?
Printable View
I've got some numbers and I'm trying to determine if rounding will occur if I store them as the type float. The numbers have six digits( e.g. 1.23456e001). How can I determine the number of significant digits that are stored in a float?
There is a define in <float.h> [or <cfloat>] called FLT_DIG (DBL_DIG or LDBL_DIG for double and long double respectively).
I'm not sure if this a "best case" or "worst case" situation.
--
Mats