[issue1559] round() does not
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 did not return just two digits, but 15 digits. the same error was produced for round(_, 3). when the number was changed to 1 digit, the return result rounded from another direction. i'd guess this isn't a feature :) -- components: Windows files: python bug.jpg messages: 58225 nosy: travelgirl severity: normal status: open title: round() does not type: behavior versions: Python 2.5 Added file: http://bugs.python.org/file8882/python bug.jpg __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1559> __<>___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1559] round() does not
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 hella accurate. that's what the bug was about. i understand the issues with BCD. i don't understand how a function to display a number can get the display so wrong, even when the BCD number itself "fails" to the 15th place. round to 2 places, you should still display 14.78, not 14.7799x just my take. thanks for getting back to me. 00 caren http://www.parkgallery.org george davis creek, north fork __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1559> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com