Re: [Tutor] int(1.99...99) = 1 and can = 2

2016-05-01 Thread boB Stepp
On Sun, May 1, 2016 at 5:43 AM, Steven D'Aprano wrote: > On Sun, May 01, 2016 at 01:02:50AM -0500, boB Stepp wrote: >> Life has kept me from Python studies since March, but now I resume. >> Playing around in the interpreter I tried: >> >> py3: 1. >> 2.0 >> py3: 1.999 >>

Re: [Tutor] int(1.99...99) = 1 and can = 2

2016-05-01 Thread Steven D'Aprano
On Sun, May 01, 2016 at 01:02:50AM -0500, boB Stepp wrote: > Life has kept me from Python studies since March, but now I resume. > Playing around in the interpreter I tried: > > py3: 1. > 2.0 > py3: 1.999 > 1.999 Correct. Python floats carry 64 bits of valu

Re: [Tutor] int(1.99...99) = 1 and can = 2

2016-05-01 Thread eryk sun
On Sun, May 1, 2016 at 1:02 AM, boB Stepp wrote: > > py3: 1. > 2.0 > py3: 1.999 > 1.999 ... > It has been many years since I did problems in converting decimal to > binary representation (Shades of two's-complement!), but I am under > the (apparently mistake

[Tutor] int(1.99...99) = 1 and can = 2

2016-04-30 Thread boB Stepp
Life has kept me from Python studies since March, but now I resume. Playing around in the interpreter I tried: py3: 1. 2.0 py3: 1.999 1.999 py3: int(1.) 2 py3: int(1.999) 1 It has been many years since I did problems in convertin