Re: working of round()

2007-04-15 Thread subscriber123
On Apr 15, 8:06 pm, [EMAIL PROTECTED] wrote: > Does round() always perfectly return the output expected or are there > some artifacts which don't allow perfect functionality > > Using python 2.5: > > >>> round(12.234, 2) > 12.23 > >>> round(12.234, 3) > 12.234 > >>> round(12.234, 1) > 12.19

Re: working of round()

2007-04-15 Thread Robert Kern
Steven Bethard wrote: > I'm not sure why you would have expected 2.62 for the latter when:: > > >>> 5.25 / 2 > 2.625 Round-to-nearest-even is a valid, and oft-recommended rounding mode for numbers exactly halfway between two round numbers. -- Robert Kern "I have come to believe that

Re: working of round()

2007-04-15 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > Does round() always perfectly return the output expected or are there > some artifacts which don't allow perfect functionality > > Using python 2.5: round(12.234, 2) > 12.23 round(12.234, 3) > 12.234 round(12.234, 1) > 12.199 > > but was expec

Re: working of round()

2007-04-15 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Does round() always perfectly return the output expected or are there > some artifacts which don't allow perfect functionality > > Using python 2.5: round(12.234, 2) > 12.23 round(12.234, 3) > 12.234 round(12.234, 1) > 12.199 > > but was expec

working of round()

2007-04-15 Thread Krishna . K . 1900
Does round() always perfectly return the output expected or are there some artifacts which don't allow perfect functionality Using python 2.5: >>> round(12.234, 2) 12.23 >>> round(12.234, 3) 12.234 >>> round(12.234, 1) 12.199 >>> but was expecting 12.2 Also, for round(x,n), can't 'x'