[Edu-sig] Math weirdness?

Robert Rickenbrode II rkr_ii@yahoo.com
Wed, 03 Oct 2001 12:03:17 -0400


Hey folks, can someone explain these to me:

 >>> import math
 >>> math.pi
3.1415926535897931
 >>> round (math.pi, 3)
3.1419999999999999
 >>>


and this:

 >>> 10./3
3.3333333333333335

These are taken from IDLE on a Win98 machine running Python 2.1.1:
 >>> import sys
 >>> print sys.version
2.1.1 (#20, Jul 20 2001, 01:19:29) [MSC 32 bit (Intel)]

Thanks, Rob

Robert K. Rickenbrode II
rkr_ii@yahoo.com