Add new rounding modes to System.Math, System.MathF (dotnet/coreclr#20815)
authorhamish-rose <hamishr@protonmail.com>
Tue, 12 Feb 2019 10:56:00 +0000 (23:56 +1300)
committerTanner Gooding <tagoo@outlook.com>
Tue, 12 Feb 2019 10:56:00 +0000 (02:56 -0800)
commita39023edfd886e6ac3a38a2127a73c9aea79a6c1
tree222858cdc38fde32313711bc08050b254cca6c94
parentf28a4f08ed286e3b2ff06ef93c246958244e0add
Add new rounding modes to System.Math, System.MathF (dotnet/coreclr#20815)

* add new rounding modes to MidpointRounding.cs

new modes added to enum
implemented ToZero for double in Math.cs

* ToZero implementation

* implement double and float rounding modes

* updating rounding implementation

now round inline with DecCalc internal round implementation

* small bug fix

also replace var to make things obvious

* update implementation - floor/ceil

code review feedback

* review feedback

add comments, update MathF with floor/ceil

* code review feedback

 - fix comments
 - replace ifelse with switch
 - remove RoundingMode enum from DecCalc

* exclude outdated corefx test

Commit migrated from https://github.com/dotnet/coreclr/commit/3397472200fc7b2b5db3dfd27a652a12831c37ee
src/coreclr/tests/CoreFX/CoreFX.issues.json
src/libraries/System.Private.CoreLib/src/System/Decimal.DecCalc.cs
src/libraries/System.Private.CoreLib/src/System/Decimal.cs
src/libraries/System.Private.CoreLib/src/System/Math.cs
src/libraries/System.Private.CoreLib/src/System/MathF.cs
src/libraries/System.Private.CoreLib/src/System/MidpointRounding.cs