Decimals to fraction strings

Mikael Olofsson mikael at isy.liu.se
Wed May 17 02:40:46 EDT 2000


On 17-May-00 François Pinard wrote:
 >  Not necessarily.  0.6667 is well approximated by 1:3, for example, while
 >  if you force the denominator to be an exponent of 10, you will obtain a
 >  fraction which is not only uglier, but less precise.

Precise in what respect? Given the (possibly rounded) number 0.6667, we 
do not know if its origin is 2/3 or something else. It might very well 
be 6667/10000. The latter is definitely closer to the given number than 
the former, thus more precise.

/Mikael

-----------------------------------------------------------------------
E-Mail:  Mikael Olofsson <mikael at isy.liu.se>
WWW:     http://www.dtr.isy.liu.se/dtr/staff/mikael
Phone:   +46 - (0)13 - 28 1343
Telefax: +46 - (0)13 - 28 1339
Date:    17-May-00
Time:    08:34:44

This message was sent by XF-Mail.
-----------------------------------------------------------------------




More information about the Python-list mailing list