Tham khảo tài liệu 'the new c standard- p5', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Characteristics of floating types 368 binary number. The number N of radix-B digits required to represent an n-digit FLT_RADIX floating-point number is given by the condition after substituting C Standard values 918 10N-1 FLT_RADIXLDBL_MANT_DIG Minimizing for N we get _ 2 LDBL MANT DIG logFLT_ _RADIX 10 When FLT-RADIX is 2 this simplifies to LDBL_MANT_DIG By using fewer decimal digits we are accepting that the decimal value may not be the one closest to the binary value. It is simply a member of the set of decimal values having the same binary value that is representable in DECIMAL_DIG digits. For instance the decimal fraction is closer to the preceding binary fraction than any other nearby binary 379 DECI-MAL_DIG conversion recommended practice When b is not a power of 10 this value will be larger than the equivalent _DIG macro. But not all of the possible combinations of DECIMAL_DIG decimal digits can be generated by a conversion. The number of T prM pcpntQl il p vqIiipo hphuppn pqp i non pr a f flip roHiv îc fivpd T irMi px PT pqp i cupppccivp nntupr rvf 1 O cnrYr r vrtc 335 precision representable values Uet Vedl each po Vel Uf Idle radix is HXed. Ho Vevel each successive po Vel vl 1O supports floating point a greater number of representable values see Figure . Eventually the number of representable decimal values in a range is greater than the number of representable p radix values. The value of DECIMAL_DIG denotes the power of 10 just before this occurs. C90 Support for the DECIMAL_DIG macro is new in C99. C Support for the DECIMAL_DIG macro is new in C99 and specified in the C Standard. Other Languages Few other languages get involved in exposing such details to the developer. Common Implementations A value of 17 would be required to support IEC 60559 double precision. A value of 9 is sufficient to support IEC 60559 single precision. The format used by Apple on the POWERPC 50 to .