[issue1559] round() does not

2007-12-05 Thread Guido van Rossum
Guido van Rossum added the comment: travelgirl: the 'decimal' module is designed to deal with this. Note that there's a difference between BCD (which can represent decimal numbers exactly) and binary (which can't, in general). -- nosy: +gvanrossum __ Trac

[issue1559] round() does not

2007-12-05 Thread Georg Brandl
Georg Brandl added the comment: round() does not return a string, but a floating point number, the best approximation to the "real" result that is achievable with the limited precision of binary floating point. That result is then formatted to a string for display by the interactive interpreter

[issue1559] round() does not

2007-12-05 Thread travelgirl
travelgirl added the comment: interesting, and expected as the BCD calculation. however, the round function should be able to handle that correctly, dealing with the number in a string fashion as opposed a mathematical one, to display the requested decimal places. slower, to be sure, but hel

[issue1559] round() does not

2007-12-05 Thread Georg Brandl
Georg Brandl added the comment: Not really a feature, but not a bug. See http://www.python.org/doc/faq/general/#why-are-floating-point-calculations-so-inaccurate for an explanation. -- nosy: +georg.brandl resolution: -> invalid status: open -> closed __

[issue1559] round() does not

2007-12-05 Thread travelgirl
New submission from travelgirl: http://docs.python.org/tut/node5.html states, as an example, round(_, 2) should round to the second decimal place. makes sense. when i attempted it with different numbers, round() returned what looks like a binary-coded decimal error (see the jpg enclosed), and d