round

David Goldsmith David.L.Goldsmith at noaa.gov
Thu Oct 12 01:03:02 CDT 2006


Charles R Harris wrote:
>
>
> On 10/11/06, *Greg Willden* <gregwillden at gmail.com 
> <mailto:gregwillden at gmail.com>> wrote:
>
>     Hi All,
>
>     I've read discussions in the archives about how round() "rounds to
>     even" and how that is supposedly better.
>
>     But what I haven't been able to find is "What do I use if I want
>     the regular old round that you learn in school?" 
>
>
> Perhaps you could explain *why* you want the schoolbook round? Given 
> that floating point is inherently inaccurate you would have to expect 
> to produce a lot of numbers exactly of the form x.5 *without errors*, 
> which means you probably don't need round to deal with it. Anyway, 
> absent a flag somewhere, you can do something like (x + 
> sign(x)*.5).astype(int).
>
> Chuck
Also, where did you go to school?  In Fairfax County, VA in the 80's at 
least, they were teaching "round to even"; since that time, I've taught 
math in a variety of locations and settings and with a variety of texts, 
and where I have seen the issue addressed, it's always "round to even" 
(or, as I learned it, "the rule of fives").

DG
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> ------------------------------------------------------------------------
>
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
>   


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642




More information about the Numpy-discussion mailing list