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

- 03-19-2008thetinmanNumber of Significant Digits in a Float
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?

- 03-19-2008matsp
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