| |
 |
|
|
Science Forum Index » Math - Numerical Analysis Forum » digits of precision
Page 1 of 1
|
| Author |
Message |
| vsgdp |
Posted: Sat Mar 03, 2007 12:02 am |
|
|
|
Guest
|
My compilers float.h header file defines:
#define DBL_DIG 15 /* # of decimal digits
of precision */
#define DBL_EPSILON 2.2204460492503131e-016 /* smallest such that
1.0+DBL_EPSILON != 1.0 */
I always thought double had 16 digits of precision. Burden & Faires'
Numerical Analysis says:
"Since 52 binary digits [plus the 1 hidden bit] correspond to between
16 and 17 decimal digits, we can assume that a number represented on
this system has at least 16 decimal digits of precision."
Can someone explain. |
|
|
| Back to top |
|
| Noone |
Posted: Sat Mar 03, 2007 3:35 am |
|
|
|
Guest
|
On 2 Mar 2007 20:02:48 -0800, "vsgdp" <cloud00769@yahoo.com> wrote:
Quote: My compilers float.h header file defines:
#define DBL_DIG 15 /* # of decimal digits
of precision */
#define DBL_EPSILON 2.2204460492503131e-016 /* smallest such that
1.0+DBL_EPSILON != 1.0 */
I always thought double had 16 digits of precision. Burden & Faires'
Numerical Analysis says:
"Since 52 binary digits [plus the 1 hidden bit] correspond to between
16 and 17 decimal digits, we can assume that a number represented on
this system has at least 16 decimal digits of precision."
Can someone explain.
Don't really know why that book says what it does. Perhaps the phrase
"on this system" has some special meaning?
The basis for the number of decimal digits of precision is the ...
/* Number of decimal digits, q, such that any floating-point number
with q decimal digits can be rounded into a floating-point number
with p radix b digits and back again without change to the q
decimal digits,
p * log10(b) if b is a power of 10
floor( (p - 1) * log10(b) ) otherwise
*/
For DBL_DIG: floor( (53-1) * log_10(2) ) = 15 |
|
|
| Back to top |
|
| |
|
Page 1 of 1
All times are GMT - 5 Hours
The time now is Tue Dec 02, 2008 1:25 am
|
|