Re: Converting decimal number to carpenter's fractions

new topic     » goto parent     » topic index » view thread      » older message » newer message
mattlewis said...
K_D_R said...
said...

For some things, decimals are easier. For other things, fractions are easier.

There are times when fractions are "cleaner" and more exact than are rounded decimals.

Please give me an example to illustrate your point.

I think the simplest example is 1/3. It has no exact representation, of course, in binary fractions (e.g., IEEE floating point numbers). Likewise, money fractions tend to be 1/100s, many of which cannot be represented exactly in binary fractions. It can be very important to get exact answers from calculations using these sorts of numbers where the errors introduced by binary approximations are unacceptable.

Matt

Just before logging on, I also thought of the example of 1/3 in terms of being easier to express than .33333... as Derek uses fractions in the code segment that inspired the original question. So, I understand that using fractions can be much easier to remember than long decimal numbers.

But as far as exactness and accuracy... 1/3 may be an exact expression, but that exactness gives an illusion of accuracy and does not appear to me to be more accurate than a rounded decimal, at least for the purpose at hand:

printf(1, "\n1/3 inch = %1.5fmm", 1/3 * 25.4)  
printf(1, "\n%1.1fmm = ", 1/3 *25.4) ?carp(1/3*25.4,mm_inch,128)                                                                                                                                                                                        
puts(1, "1/3 inch, base 128 = ")     ?carp(1/3, 1, 128)                                                                                                                             
puts(1, "1/3 inch, base 16 = ")      ?carp(1/3, 1, 16) 
puts(1, "43/128inch-5/16inch = ")    ?carp(43/128-5/16,1,32)   

1/3 inch = 8.46667mm 
8.5mm = {0,43,128,1} 
1/3 inch, base 128 = {0,43,128,1} 
1/3 inch, base 16 = {0,5,16,1} 
43/128inch-5/16inch = {0,1,32,1} 

Did I do this right? The rounded decimal figure appears to be as accurate as the most accurate fraction. Also, I dare say it is much easier to use. My metric/inch tape measure is marked in 16ths of an inch. Simple rounding of the metric reading appears to be more accurate by 1/32", right?

Regards, Kenneth Rhodes

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu