Decimals to fraction strings

Dave Hansen dhansen at cyberoptics.com
Wed May 17 11:24:49 EDT 2000


On 16 May 2000 22:49:54 -0400, =?ISO-8859-1?Q?Fran=E7ois_Pinard?=
<pinard at iro.umontreal.ca> wrote:

>mjackson at wc.eso.mc.xerox.com (Mark Jackson) writes:
[...]
>> <dumb look>
>> Is not this same constraint applied by the problem itself, which starts
>> with a [finite length] decimal representation?
>> </dumb look>
>
>Not necessarily.  0.6667 is well approximated by 1:3, for example, while

ITYM 2/3.

>if you force the denominator to be an exponent of 10, you will obtain a
>fraction which is not only uglier, but less precise.

Uglier, perhaps.  But 6667/10000 is a somewhat more precise
approximation of .6667 than is 2/3.

Regards,

                              -=Dave
-- 
The opinions expressed in this post are my own and do not 
represent the views of CyberOptics Corporation.
Change is inevitable.  Except from a vending machine.



More information about the Python-list mailing list