[Doc-SIG] Re: Issues with 2.1 doc PDF files

Dinu Gherman gherman@darwin.in-berlin.de
Wed, 25 Apr 2001 12:08:11 +0200


I wrote:
> 
> I've just noticed that there are considerable differences
> between the PDF files documenting Python 2.1 and those for
> 2.0. [...]

After running a diff over tut.tex for both versions I get an
even more interesting difference concerning the *content*
(left 2.0, right 2.1, excerpts only):

  2603c2620
  < '[31.4, 40000]'
  ---
  > '[31.400000000000002, 40000]'
  2611c2628
  < "(31.4, 40000, ('spam', 'eggs'))"
  ---
  > "(31.400000000000002, 40000, ('spam', 'eggs'))"

Being curious, I typed the following into Pythonwin and am
quite baffled by the results:

  PythonWin 2.0 (#8, Oct 16 2000, 17:27:58) [MSC 32 bit (Intel)] 
  [...]
  >>> x = 10 * 3.14
  >>> x
  31.400000000000002
  >>> x == 31.4
  0
  >>> 3.14
  3.1400000000000001
  >>> 

Aparently the doc for 2.0 might have been generated with 
1.5.2, but I don't have a running 1.5.2 to cross-check 
this quickly.

I guess for many this must look like something unexpected,
isn't it? But is it a reason to panic? I don't find anything 
explaining this behaviour in the FAQ. If it has to do with
internal floating point representation limits it might be
an issue of general interest and worth being documented
somewhere.

If this observation was discussed long ago on comp.lang.python
please forgive me (and point me to it), but I haven't had the 
time to follow this group very much recently...

Regards,

Dinu

-- 
Dinu C. Gherman
ReportLab Consultant - http://www.reportlab.com
................................................................
"The only possible values [for quality] are 'excellent' and 'in-
sanely excellent', depending on whether lives are at stake or 
not. Otherwise you don't enjoy your work, you don't work well, 
and the project goes down the drain." 
                    (Kent Beck, "Extreme Programming Explained")