Inexact representation cases (Re: Against PEP 240)

Clark C . Evans cce at clarkevans.com
Sat Jun 2 13:06:51 EDT 2001


On Sat, Jun 02, 2001 at 03:53:08PM +0000, Grant Edwards wrote:
| >| >>> 1.1
| >| 1.1000000000000001
| >| >>> 7.35
| >| 7.3499999999999996
| >
| >What is the general pattern for these types of inexact
| >represenatation?
| 
| 1/10 (base 10) is not representable in a finite base-2 number,
| in the same way that 2/3 is not representable in a finite
| base-10 number.
| 
| The same goes for 35/100

*slaps hand against head and says "Duh!"*
  
Thanks!

Clark




More information about the Python-list mailing list