Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Derivation of the C Standard's Formula for FLT_DIG, DBL_DIG, LDBL_DIG

Reply
Thread Tools

Derivation of the C Standard's Formula for FLT_DIG, DBL_DIG, LDBL_DIG

 
 
John Reye
Guest
Posts: n/a
 
      07-07-2012
Hi,

have you seen the C Standards formula for FLT_DIG, DBL_DIG, LDBL_DIG?

http://www.open-std.org/jtc1/sc22/wg...70.pdf#page=49 (pdf-
page 49)

If you have a capable browser, it can be displayed like this:

⎧ p log10 b if b is a power of 10
q = ⎨
⎩ ⎣( p − 1) log10 b⎦ otherwise



How does one derive this formula? (And: is it correct, in the sense of
really defining the maximum for q ?)

I'm particularly interested in the "otherwise" case, which states q <=
floor((p-1)*log10(b))

In particular: cannot q be somewhat larger, as in q <=
floor(p*log10(b)) = LIM ??? I believe that also results in no rounding
loss; and an exact representation (of the original decimal number)
with p radix-b digits.

(((In fact... q might even be able to be larger still (than LIM), for
cases where there is a non-exact representation of the original number
with p radix-b digits; but rounding back to base-10, would still yield
the original number.)))

Thanks.
J.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Derivation of the C Standard's Formula for FLT_DIG, DBL_DIG, LDBL_DIG John Reye C Programming 9 07-08-2012 06:01 PM
portected access: template derivation vs. class derivation Steven T. Hatton C++ 12 08-20-2004 04:56 AM
derivation milliweasel@neomeo.com Perl 0 04-24-2004 10:42 PM
Derivation by restriction - can I change element reference? Grisha Golberg XML 0 03-03-2004 09:19 PM
derivation, restriction, extension, ... Benjamin Michotte XML 1 09-05-2003 09:47 AM



Advertisments