Solved

# VC++6: precision of long double

Posted on 2000-05-09

in <float.h> DBL_DIG is defined to be 15 (max digits of precision. While for lone double it's 15 ifndef _M_M68K, it's 18 if _M_M68K is defined. My program need a precision of 18, guess i will have to define _M_M68K in my program? And BTW, what is the meaning of _M_M68K??

Attachment: <float.h>

#ifndef _M_M68K

#define LDBL_DIG DBL_DIG /* # of decimal digits of precision */

#define LDBL_EPSILON DBL_EPSILON /* smallest such that 1.0+LDBL_EPSILON != 1.0 */

#define LDBL_MANT_DIG DBL_MANT_DIG /* # of bits in mantissa */

#define LDBL_MAX DBL_MAX /* max value */

#define LDBL_MAX_10_EXP DBL_MAX_10_EXP /* max decimal exponent */

#define LDBL_MAX_EXP DBL_MAX_EXP /* max binary exponent */

#define LDBL_MIN DBL_MIN /* min positive value */

#define LDBL_MIN_10_EXP DBL_MIN_10_EXP /* min decimal exponent */

#define LDBL_MIN_EXP DBL_MIN_EXP /* min binary exponent */

#define _LDBL_RADIX DBL_RADIX /* exponent radix */

#define _LDBL_ROUNDS DBL_ROUNDS /* addition rounding: near */

#else

#define LDBL_DIG 18 /* # of decimal digits of precision */

#define LDBL_EPSILON 1.08420217248550443412e-019L /* smallest such that 1.0+LDBL_EPSILON != 1.0 */

#define LDBL_MANT_DIG 64 /* # of bits in mantissa */

#define LDBL_MAX 1.189731495357231765e+4932L /* max value */

#define LDBL_MAX_10_EXP 4932 /* max decimal exponent */

#define LDBL_MAX_EXP 16384 /* max binary exponent */

#define LDBL_MIN 3.3621031431120935063e-4932L /* min positive value */

#define LDBL_MIN_10_EXP (-4931) /* min decimal exponent */

#define LDBL_MIN_EXP (-16381) /* min binary exponent */

#define _LDBL_RADIX 2 /* exponent radix */

#define _LDBL_ROUNDS 1 /* addition rounding: near */

#endif