Re: [Tutor] Floating Confusion

2007-08-23 Thread Kent Johnson
Luke Paireepinart wrote: > I've always wondered: > There are numbers in Decimal that can't be represented accurately in > Binary without infinite precision. > But it doesn't go the other way. Rational base-2 numbers are rational > base-10 numbers. I'm supposing this is because base-10 is a hig

Re: [Tutor] Floating Confusion

2007-08-23 Thread Alan Gauld
"wormwood_3" <[EMAIL PROTECTED]> wrote 1.1 > 1.1001 > "1.1" is a float type, and apparently it cannot be represented by > binary floating point numbers accurately. > I must admit that I do not understand why this is the case. This isn't just a problem in binary. Consider u

Re: [Tutor] Floating Confusion

2007-08-22 Thread Luke Paireepinart
Chris Calloway wrote: > wormwood_3 wrote: > >> The second case is, of course, what is throwing me. By having a decimal >> point, "1.1" is a float type, and apparently it cannot be represented by >> binary floating point numbers accurately. I must admit that I do not >> understand why this is

Re: [Tutor] Floating Confusion

2007-08-22 Thread Chris Calloway
wormwood_3 wrote: > The second case is, of course, what is throwing me. By having a decimal > point, "1.1" is a float type, and apparently it cannot be represented by > binary floating point numbers accurately. I must admit that I do not > understand why this is the case. Would anyone be able to

Re: [Tutor] Floating Confusion

2007-08-22 Thread Kent Johnson
wormwood_3 wrote: 1.1 > 1.1001 > The second case is, of course, what is throwing me. By having a > decimal point, "1.1" is a float type, and apparently it cannot be > represented by binary floating point numbers accurately. I must admit > that I do not understand why this is the c

[Tutor] Floating Confusion

2007-08-22 Thread wormwood_3
Dear Tutors, Reading through Wesley's delightful Core Python Programming, I came across something I have not been able to grasp yet. Some introductory code: >>> 1 1 >>> 1.1 1.1001 >>> print 1 1 >>> print 1.1 1.1 The second case is, of course, what is throwing me. By having a decim