Skip to content

Commit

Permalink
Refactoring the generic-math CreateChecked/Saturating/Truncating APIs…
Browse files Browse the repository at this point in the history
… to match API review (#69756)

* Update MicrosoftNetCompilersToolsetVersion to 4.3.0-2.22270.4

* Moving System.Runtime.InteropServices.NFloat down to System.Runtime

* Removing the generic-math CreateChecked, CreateSaturating, CreateTruncating, and TryCreate implementations

* Removing the generic-math TryCreate tests

* Adding the TryConvertTo* and TryConvertFrom* generic math APIs for Checked, Saturating, and Truncating

* Filling out test coverage for the CreateChecked generic-math API

* Fix some edge cases for the CreateSaturating generic-math APIs

* Filling out test coverage for the CreateSaturating generic-math API

* Fix some edge cases for the CreateTruncating generic-math APIs

* Filling out test coverage for the CreateTruncating generic-math API

* Fixing some edge cases in converting BigInteger/Complex to the primitive types

* Filling out test coverage for converting BigInteger and Complex to the primitive types

* Fixing some 32-bit generic-math tests

* Removing the static virtual declarations since things are falling over

* Skipping some tests on Mono where it has bad behavior

* Revert "Removing the static virtual declarations since things are falling over"

This reverts commit baf69de.

* Move NFloat back to System.Runtime.InteropServices based on feedback

* Fixing the Int128/UInt128 to Decimal tests

* Ensure `JIT_Dbl2ULng` correctly handles NaN

* Revert "Ensure `JIT_Dbl2ULng` correctly handles NaN"

This reverts commit 3298345.

* Explicitly ensure floating-point to ulong conversion returns 0 for NaN
  • Loading branch information
tannergooding authored May 28, 2022
1 parent 38681fe commit 748dfb7
Show file tree
Hide file tree
Showing 48 changed files with 17,321 additions and 11,323 deletions.
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<!--
TODO: Remove pinned version once arcade supplies a 4.3 compiler.
-->
<MicrosoftNetCompilersToolsetVersion>4.3.0-2.22270.2</MicrosoftNetCompilersToolsetVersion>
<MicrosoftNetCompilersToolsetVersion>4.3.0-2.22270.4</MicrosoftNetCompilersToolsetVersion>
<!-- SDK dependencies -->
<MicrosoftDotNetCompatibilityVersion>2.0.0-preview.4.22252.4</MicrosoftDotNetCompatibilityVersion>
<!-- Arcade dependencies -->
Expand Down
3 changes: 0 additions & 3 deletions src/libraries/Common/tests/System/GenericMathHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,6 @@ public static TSelf CreateTruncating<TOther>(TOther value)

public static TSelf Parse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider provider) => TSelf.Parse(s, style, provider);

public static bool TryCreate<TOther>(TOther value, out TSelf result)
where TOther : INumberBase<TOther> => TSelf.TryCreate(value, out result);

public static bool TryParse(string s, NumberStyles style, IFormatProvider provider, out TSelf result) => TSelf.TryParse(s, style, provider, out result);

public static bool TryParse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider provider, out TSelf result) => TSelf.TryParse(s, style, provider, out result);
Expand Down
665 changes: 332 additions & 333 deletions src/libraries/System.Private.CoreLib/src/System/Byte.cs

Large diffs are not rendered by default.

656 changes: 335 additions & 321 deletions src/libraries/System.Private.CoreLib/src/System/Char.cs

Large diffs are not rendered by default.

Loading

0 comments on commit 748dfb7

Please sign in to comment.