-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow choice of rounding behavior for ties
Traditionally, rounding a value that is exactly halfway between to round values results in the higher round value: 10 == 5.round_to(10, Tie::Up) This adds a parameter and `enum` to allow other rules for dealing with “ties” — values that are halfway between two round numbers. The rule mentioned above is represented by `Tie::Up` — ties choose the higher number. The complete list of options is: * `Tie::Up` * `Tie::Down` * `Tie::TowardZero` * `Tie::AwayFromZero` * `Tie::TowardEven` * `Tie::TowardOdd`
- Loading branch information
1 parent
0fc436d
commit 5b16b13
Showing
2 changed files
with
713 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.