[docs] possible dox bug in floating point tutorial

Daniel Lichtblau danl at wolfram.com
Mon Jan 13 18:00:28 CET 2014


(I'm not sure if this is a bug but it seems mysterious.)

http://docs.python.org/2.6/tutorial/floatingpoint.html

Mentions that 0.1, under the hood, is a fairly long decimal.
Specifically:
"On most machines, if Python were to print the true
decimal value of the binary approximation stored for 0.1, it would have to
display

>>>0.1
0.1000000000000000055511151231257827021181583404541015625

instead!"

This seems to be too long for any hardware floating point representation,
even quad. Also the length of that decimal string is 54. While that's not
quite as suspicious as 53, it still makes one wonder if that should be
the length of the corresponding display for a binary representation.

Daniel Lichtblau
Wolfram Research



More information about the docs mailing list