Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
Float.round - should it be round-to-even
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Stefano Taschini, post: 4512483"] Consider e.g. the computation of the median of an array with floats. If your input data are floats and your result is also a float, may ask you why you want to round them? If you are actually thinking of rounding errors, i.e., the fact that (1/2.0) + (1/3.0) != 5/6.0, well, they are independent of Float#round. By the way, the median [1] is hardly biased by rounding errors. It's the mean that is sensitive to that. Ciao, Stefano [1] [URL]http://mathworld.wolfram.com/StatisticalMedian.html[/URL] [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
Float.round - should it be round-to-even
Top