diff --git a/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.sln b/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.sln index 66c65e680d4693..a0a5851a6ffd71 100644 --- a/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.sln +++ b/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.28902.138 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.32818.431 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Private.CoreLib", "System.Private.CoreLib.csproj", "{3DA06C3A-2E7B-4CB7-80ED-9B12916013F9}" EndProject @@ -9,10 +9,6 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Private.CoreLib.Generators", "..\..\libraries\System.Private.CoreLib\gen\System.Private.CoreLib.Generators.csproj", "{7196828B-5E00-4BC6-9A1E-492C948E41A3}" EndProject Global - GlobalSection(SharedMSBuildProjectFiles) = preSolution - ..\..\libraries\System.Private.CoreLib\src\System.Private.CoreLib.Shared.projitems*{3da06c3a-2e7b-4cb7-80ed-9b12916013f9}*SharedItemsImports = 5 - ..\..\libraries\System.Private.CoreLib\src\System.Private.CoreLib.Shared.projitems*{845c8b26-350b-4e63-bd11-2c8150444e28}*SharedItemsImports = 13 - EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Checked|amd64 = Checked|amd64 Checked|Any CPU = Checked|Any CPU @@ -95,4 +91,7 @@ Global GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {DA05075A-7CDA-4F65-AF6A-CB5DB6CF936F} EndGlobalSection + GlobalSection(SharedMSBuildProjectFiles) = preSolution + ..\..\libraries\System.Private.CoreLib\src\System.Private.CoreLib.Shared.projitems*{845c8b26-350b-4e63-bd11-2c8150444e28}*SharedItemsImports = 13 + EndGlobalSection EndGlobal diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/NumberFormatInfo.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/NumberFormatInfo.cs index 3d2c60fd01550b..b3ab95500b35c8 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/NumberFormatInfo.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/NumberFormatInfo.cs @@ -136,7 +136,7 @@ private static void VerifyDigitSubstitution(DigitShapes digitSub, string propert } internal bool HasInvariantNumberSigns => _hasInvariantNumberSigns; - internal bool AllowHyphenDuringParsing => _allowHyphenDuringParsing; + public bool AllowHyphenDuringParsing => _allowHyphenDuringParsing; private void InitializeInvariantAndNegativeSignFlags() { diff --git a/src/libraries/System.Runtime.Numerics/System.Runtime.Numerics.sln b/src/libraries/System.Runtime.Numerics/System.Runtime.Numerics.sln index 5da865b1d49b3b..8597b7fb2cc642 100644 --- a/src/libraries/System.Runtime.Numerics/System.Runtime.Numerics.sln +++ b/src/libraries/System.Runtime.Numerics/System.Runtime.Numerics.sln @@ -1,4 +1,8 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.32818.431 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUtilities", "..\Common\tests\TestUtilities\TestUtilities.csproj", "{A22876CA-76C0-4ABD-8658-C2B3DFDFE537}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibraryImportGenerator", "..\System.Runtime.InteropServices\gen\LibraryImportGenerator\LibraryImportGenerator.csproj", "{55FC83C5-F34D-4B4B-BEAE-497DD5653BCE}" @@ -61,12 +65,12 @@ Global EndGlobalSection GlobalSection(NestedProjects) = preSolution {A22876CA-76C0-4ABD-8658-C2B3DFDFE537} = {A80D3604-A8C8-4B23-B0D3-316E46CFE60A} - {2C4CBA2D-4C9D-4B83-85A4-2DF75C91B0FC} = {A80D3604-A8C8-4B23-B0D3-316E46CFE60A} {55FC83C5-F34D-4B4B-BEAE-497DD5653BCE} = {94F2DDDF-A2DA-4F69-9613-A92D50D84A1C} {57EC916C-15B4-46BB-AE68-B4CD8BC7076C} = {94F2DDDF-A2DA-4F69-9613-A92D50D84A1C} {C91AC3B4-647B-4D7F-83CA-BE90FFFC8CF3} = {18C5FB7C-2DE7-4BED-BA2B-53776E78E1E5} - {DB1922E9-EC35-44AC-9677-277B7D00595F} = {18C5FB7C-2DE7-4BED-BA2B-53776E78E1E5} {91F8FBEF-C085-4542-BEE4-22449D80734A} = {F6066198-D324-499F-BEB7-55DF39460AB4} + {2C4CBA2D-4C9D-4B83-85A4-2DF75C91B0FC} = {A80D3604-A8C8-4B23-B0D3-316E46CFE60A} + {DB1922E9-EC35-44AC-9677-277B7D00595F} = {18C5FB7C-2DE7-4BED-BA2B-53776E78E1E5} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {B7C7E4C6-78B9-4AE7-AC8B-4F08EAD0DECB} diff --git a/src/libraries/System.Runtime.Numerics/ref/System.Runtime.Numerics.cs b/src/libraries/System.Runtime.Numerics/ref/System.Runtime.Numerics.cs index 0d371c4d7886c6..416dbb1bc41474 100644 --- a/src/libraries/System.Runtime.Numerics/ref/System.Runtime.Numerics.cs +++ b/src/libraries/System.Runtime.Numerics/ref/System.Runtime.Numerics.cs @@ -194,10 +194,10 @@ namespace System.Numerics public static System.Numerics.BigInteger RotateLeft(System.Numerics.BigInteger value, int rotateAmount) { throw null; } public static System.Numerics.BigInteger RotateRight(System.Numerics.BigInteger value, int rotateAmount) { throw null; } public static System.Numerics.BigInteger Subtract(System.Numerics.BigInteger left, System.Numerics.BigInteger right) { throw null; } - static bool System.Numerics.IBinaryInteger.TryReadBigEndian(System.ReadOnlySpan source, bool isUnsigned, out System.Numerics.BigInteger value) { throw null; } - static bool System.Numerics.IBinaryInteger.TryReadLittleEndian(System.ReadOnlySpan source, bool isUnsigned, out System.Numerics.BigInteger value) { throw null; } int System.Numerics.IBinaryInteger.GetByteCount() { throw null; } int System.Numerics.IBinaryInteger.GetShortestBitLength() { throw null; } + static bool System.Numerics.IBinaryInteger.TryReadBigEndian(System.ReadOnlySpan source, bool isUnsigned, out System.Numerics.BigInteger value) { throw null; } + static bool System.Numerics.IBinaryInteger.TryReadLittleEndian(System.ReadOnlySpan source, bool isUnsigned, out System.Numerics.BigInteger value) { throw null; } bool System.Numerics.IBinaryInteger.TryWriteBigEndian(System.Span destination, out int bytesWritten) { throw null; } bool System.Numerics.IBinaryInteger.TryWriteLittleEndian(System.Span destination, out int bytesWritten) { throw null; } static bool System.Numerics.INumberBase.IsCanonical(System.Numerics.BigInteger value) { throw null; } @@ -382,4 +382,201 @@ namespace System.Numerics public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Numerics.Complex result) { throw null; } public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out System.Numerics.Complex result) { throw null; } } + public readonly partial struct Decimal32 : System.IComparable, System.IComparable, System.IEquatable, System.IFormattable, System.IParsable, System.ISpanFormattable, System.ISpanParsable, System.Numerics.IAdditionOperators, System.Numerics.IAdditiveIdentity, System.Numerics.IComparisonOperators, System.Numerics.IDecrementOperators, System.Numerics.IDivisionOperators, System.Numerics.IEqualityOperators, System.Numerics.IFloatingPoint, System.Numerics.IFloatingPointConstants, System.Numerics.IIncrementOperators, System.Numerics.IMinMaxValue, System.Numerics.IModulusOperators, System.Numerics.IMultiplicativeIdentity, System.Numerics.IMultiplyOperators, System.Numerics.INumber, System.Numerics.INumberBase, System.Numerics.ISignedNumber, System.Numerics.ISubtractionOperators, System.Numerics.IUnaryNegationOperators, System.Numerics.IUnaryPlusOperators + { + private readonly int _dummyPrimitive; + public static System.Numerics.Decimal32 E { get { throw null; } } + public static System.Numerics.Decimal32 Epsilon { get { throw null; } } + public static System.Numerics.Decimal32 MaxValue { get { throw null; } } + public static System.Numerics.Decimal32 MinValue { get { throw null; } } + public static System.Numerics.Decimal32 MultiplicativeIdentity { get { throw null; } } + public static System.Numerics.Decimal32 NaN { get { throw null; } } + public static System.Numerics.Decimal32 NegativeInfinity { get { throw null; } } + public static System.Numerics.Decimal32 NegativeOne { get { throw null; } } + public static System.Numerics.Decimal32 NegativeZero { get { throw null; } } + public static System.Numerics.Decimal32 One { get { throw null; } } + public static System.Numerics.Decimal32 Pi { get { throw null; } } + public static System.Numerics.Decimal32 PositiveInfinity { get { throw null; } } + static System.Numerics.Decimal32 System.Numerics.IAdditiveIdentity.AdditiveIdentity { get { throw null; } } + static int System.Numerics.INumberBase.Radix { get { throw null; } } + public static System.Numerics.Decimal32 Tau { get { throw null; } } + public static System.Numerics.Decimal32 Zero { get { throw null; } } + public static System.Numerics.Decimal32 Abs(System.Numerics.Decimal32 value) { throw null; } + public static System.Numerics.Decimal32 BitDecrement(System.Numerics.Decimal32 x) { throw null; } + public static System.Numerics.Decimal32 BitIncrement(System.Numerics.Decimal32 x) { throw null; } + public static System.Numerics.Decimal32 Ceiling(System.Numerics.Decimal32 x) { throw null; } + public static System.Numerics.Decimal32 Clamp(System.Numerics.Decimal32 value, System.Numerics.Decimal32 min, System.Numerics.Decimal32 max) { throw null; } + public int CompareTo(System.Numerics.Decimal32 other) { throw null; } + public int CompareTo(object? obj) { throw null; } + public static System.Numerics.Decimal32 CopySign(System.Numerics.Decimal32 value, System.Numerics.Decimal32 sign) { throw null; } + public static System.Numerics.Decimal32 CreateChecked(TOther value) where TOther : System.Numerics.INumberBase { throw null; } + public static System.Numerics.Decimal32 CreateSaturating(TOther value) where TOther : System.Numerics.INumberBase { throw null; } + public static System.Numerics.Decimal32 CreateTruncating(TOther value) where TOther : System.Numerics.INumberBase { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Numerics.Decimal32 DecodeBinary(uint x) { throw null; } + [System.CLSCompliantAttribute(false)] + public static System.Numerics.Decimal32 DecodeDecimal(uint x) { throw null; } + [System.CLSCompliantAttribute(false)] + public static uint EncodeBinary(System.Numerics.Decimal32 x) { throw null; } + [System.CLSCompliantAttribute(false)] + public static uint EncodeDecimal(System.Numerics.Decimal32 x) { throw null; } + public bool Equals(System.Numerics.Decimal32 other) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } + public static System.Numerics.Decimal32 Floor(System.Numerics.Decimal32 x) { throw null; } + public static System.Numerics.Decimal32 FusedMultiplyAdd(System.Numerics.Decimal32 left, System.Numerics.Decimal32 right, System.Numerics.Decimal32 addend) { throw null; } + public override int GetHashCode() { throw null; } + public static System.Numerics.Decimal32 Ieee754Remainder(System.Numerics.Decimal32 left, System.Numerics.Decimal32 right) { throw null; } + public static int ILogB(System.Numerics.Decimal32 x) { throw null; } + public static bool IsEvenInteger(System.Numerics.Decimal32 value) { throw null; } + public static bool IsFinite(System.Numerics.Decimal32 value) { throw null; } + public static bool IsInfinity(System.Numerics.Decimal32 value) { throw null; } + public static bool IsInteger(System.Numerics.Decimal32 value) { throw null; } + public static bool IsNaN(System.Numerics.Decimal32 value) { throw null; } + public static bool IsNegative(System.Numerics.Decimal32 value) { throw null; } + public static bool IsNegativeInfinity(System.Numerics.Decimal32 value) { throw null; } + public static bool IsNormal(System.Numerics.Decimal32 value) { throw null; } + public static bool IsOddInteger(System.Numerics.Decimal32 value) { throw null; } + public static bool IsPositive(System.Numerics.Decimal32 value) { throw null; } + public static bool IsPositiveInfinity(System.Numerics.Decimal32 value) { throw null; } + public static bool IsRealNumber(System.Numerics.Decimal32 value) { throw null; } + public static bool IsSubnormal(System.Numerics.Decimal32 value) { throw null; } + public static System.Numerics.Decimal32 Lerp(System.Numerics.Decimal32 value1, System.Numerics.Decimal32 value2, System.Numerics.Decimal32 amount) { throw null; } + public static System.Numerics.Decimal32 Max(System.Numerics.Decimal32 x, System.Numerics.Decimal32 y) { throw null; } + public static System.Numerics.Decimal32 MaxMagnitude(System.Numerics.Decimal32 x, System.Numerics.Decimal32 y) { throw null; } + public static System.Numerics.Decimal32 MaxMagnitudeNumber(System.Numerics.Decimal32 x, System.Numerics.Decimal32 y) { throw null; } + public static System.Numerics.Decimal32 MaxNumber(System.Numerics.Decimal32 x, System.Numerics.Decimal32 y) { throw null; } + public static System.Numerics.Decimal32 Min(System.Numerics.Decimal32 x, System.Numerics.Decimal32 y) { throw null; } + public static System.Numerics.Decimal32 MinMagnitude(System.Numerics.Decimal32 x, System.Numerics.Decimal32 y) { throw null; } + public static System.Numerics.Decimal32 MinMagnitudeNumber(System.Numerics.Decimal32 x, System.Numerics.Decimal32 y) { throw null; } + public static System.Numerics.Decimal32 MinNumber(System.Numerics.Decimal32 x, System.Numerics.Decimal32 y) { throw null; } + public static System.Numerics.Decimal32 operator +(System.Numerics.Decimal32 left, System.Numerics.Decimal32 right) { throw null; } + public static explicit operator checked byte (System.Numerics.Decimal32 value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static explicit operator checked sbyte (System.Numerics.Decimal32 value) { throw null; } + public static explicit operator checked char (System.Numerics.Decimal32 value) { throw null; } + public static explicit operator checked short (System.Numerics.Decimal32 value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static explicit operator checked ushort (System.Numerics.Decimal32 value) { throw null; } + public static explicit operator checked int (System.Numerics.Decimal32 value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static explicit operator checked uint (System.Numerics.Decimal32 value) { throw null; } + public static explicit operator checked nint (System.Numerics.Decimal32 value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static explicit operator checked nuint (System.Numerics.Decimal32 value) { throw null; } + public static explicit operator checked long (System.Numerics.Decimal32 value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static explicit operator checked ulong (System.Numerics.Decimal32 value) { throw null; } + public static explicit operator checked System.Int128 (System.Numerics.Decimal32 value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static explicit operator checked System.UInt128 (System.Numerics.Decimal32 value) { throw null; } + public static System.Numerics.Decimal32 operator --(System.Numerics.Decimal32 value) { throw null; } + public static System.Numerics.Decimal32 operator /(System.Numerics.Decimal32 left, System.Numerics.Decimal32 right) { throw null; } + public static bool operator ==(System.Numerics.Decimal32 left, System.Numerics.Decimal32 right) { throw null; } + public static explicit operator System.Numerics.Decimal32 (decimal value) { throw null; } + public static explicit operator System.Numerics.Decimal32 (double value) { throw null; } + public static explicit operator System.Numerics.Decimal32 (System.Half value) { throw null; } + public static explicit operator System.Numerics.Decimal32 (System.Int128 value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static explicit operator System.Numerics.Decimal32 (int value) { throw null; } + public static explicit operator System.Numerics.Decimal32 (long value) { throw null; } + public static explicit operator System.Numerics.Decimal32 (nint value) { throw null; } + public static explicit operator byte (System.Numerics.Decimal32 value) { throw null; } + public static explicit operator char (System.Numerics.Decimal32 value) { throw null; } + public static explicit operator decimal (System.Numerics.Decimal32 value) { throw null; } + public static explicit operator double (System.Numerics.Decimal32 value) { throw null; } + public static explicit operator System.Half (System.Numerics.Decimal32 value) { throw null; } + public static explicit operator System.Int128 (System.Numerics.Decimal32 value) { throw null; } + public static explicit operator short (System.Numerics.Decimal32 value) { throw null; } + public static explicit operator int (System.Numerics.Decimal32 value) { throw null; } + public static explicit operator long (System.Numerics.Decimal32 value) { throw null; } + public static explicit operator nint (System.Numerics.Decimal32 value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static explicit operator sbyte (System.Numerics.Decimal32 value) { throw null; } + public static explicit operator float (System.Numerics.Decimal32 value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static explicit operator System.UInt128 (System.Numerics.Decimal32 value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static explicit operator ushort (System.Numerics.Decimal32 value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static explicit operator uint (System.Numerics.Decimal32 value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static explicit operator ulong (System.Numerics.Decimal32 value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static explicit operator nuint (System.Numerics.Decimal32 value) { throw null; } + public static explicit operator System.Numerics.Decimal32 (float value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static explicit operator System.Numerics.Decimal32 (System.UInt128 value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static explicit operator System.Numerics.Decimal32 (uint value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static explicit operator System.Numerics.Decimal32 (ulong value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static explicit operator System.Numerics.Decimal32 (nuint value) { throw null; } + public static bool operator >(System.Numerics.Decimal32 left, System.Numerics.Decimal32 right) { throw null; } + public static bool operator >=(System.Numerics.Decimal32 left, System.Numerics.Decimal32 right) { throw null; } + public static implicit operator System.Numerics.Decimal32 (byte value) { throw null; } + public static implicit operator System.Numerics.Decimal32 (char value) { throw null; } + public static implicit operator System.Numerics.Decimal32 (short value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static implicit operator System.Numerics.Decimal32 (sbyte value) { throw null; } + [System.CLSCompliantAttribute(false)] + public static implicit operator System.Numerics.Decimal32 (ushort value) { throw null; } + public static System.Numerics.Decimal32 operator ++(System.Numerics.Decimal32 value) { throw null; } + public static bool operator !=(System.Numerics.Decimal32 left, System.Numerics.Decimal32 right) { throw null; } + public static bool operator <(System.Numerics.Decimal32 left, System.Numerics.Decimal32 right) { throw null; } + public static bool operator <=(System.Numerics.Decimal32 left, System.Numerics.Decimal32 right) { throw null; } + public static System.Numerics.Decimal32 operator %(System.Numerics.Decimal32 left, System.Numerics.Decimal32 right) { throw null; } + public static System.Numerics.Decimal32 operator *(System.Numerics.Decimal32 left, System.Numerics.Decimal32 right) { throw null; } + public static System.Numerics.Decimal32 operator -(System.Numerics.Decimal32 left, System.Numerics.Decimal32 right) { throw null; } + public static System.Numerics.Decimal32 operator -(System.Numerics.Decimal32 value) { throw null; } + public static System.Numerics.Decimal32 operator +(System.Numerics.Decimal32 value) { throw null; } + public static System.Numerics.Decimal32 Parse(System.ReadOnlySpan s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.AllowDecimalPoint | System.Globalization.NumberStyles.AllowExponent | System.Globalization.NumberStyles.AllowLeadingSign | System.Globalization.NumberStyles.AllowLeadingWhite | System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.AllowTrailingWhite, System.IFormatProvider? provider = null) { throw null; } + public static System.Numerics.Decimal32 Parse(System.ReadOnlySpan s, System.IFormatProvider? provider) { throw null; } + public static System.Numerics.Decimal32 Parse(string s) { throw null; } + public static System.Numerics.Decimal32 Parse(string s, System.Globalization.NumberStyles style) { throw null; } + public static System.Numerics.Decimal32 Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; } + public static System.Numerics.Decimal32 Parse(string s, System.IFormatProvider? provider) { throw null; } + public static System.Numerics.Decimal32 Quantize(System.Numerics.Decimal32 x, System.Numerics.Decimal32 y) { throw null; } + public static System.Numerics.Decimal32 Quantum(System.Numerics.Decimal32 x) { throw null; } + public static System.Numerics.Decimal32 ReciprocalEstimate(System.Numerics.Decimal32 x) { throw null; } + public static System.Numerics.Decimal32 ReciprocalSqrtEstimate(System.Numerics.Decimal32 x) { throw null; } + public static System.Numerics.Decimal32 Round(System.Numerics.Decimal32 x) { throw null; } + public static System.Numerics.Decimal32 Round(System.Numerics.Decimal32 x, int digits) { throw null; } + public static System.Numerics.Decimal32 Round(System.Numerics.Decimal32 x, int digits, System.MidpointRounding mode) { throw null; } + public static System.Numerics.Decimal32 Round(System.Numerics.Decimal32 x, System.MidpointRounding mode) { throw null; } + public static bool SameQuantum(System.Numerics.Decimal32 x, System.Numerics.Decimal32 y) { throw null; } + public static System.Numerics.Decimal32 ScaleB(System.Numerics.Decimal32 x, int n) { throw null; } + public static int Sign(System.Numerics.Decimal32 value) { throw null; } + public static System.Numerics.Decimal32 Sqrt(System.Numerics.Decimal32 x) { throw null; } + int System.Numerics.IFloatingPoint.GetExponentByteCount() { throw null; } + int System.Numerics.IFloatingPoint.GetExponentShortestBitLength() { throw null; } + int System.Numerics.IFloatingPoint.GetSignificandBitLength() { throw null; } + int System.Numerics.IFloatingPoint.GetSignificandByteCount() { throw null; } + bool System.Numerics.IFloatingPoint.TryWriteExponentBigEndian(System.Span destination, out int bytesWritten) { throw null; } + bool System.Numerics.IFloatingPoint.TryWriteExponentLittleEndian(System.Span destination, out int bytesWritten) { throw null; } + bool System.Numerics.IFloatingPoint.TryWriteSignificandBigEndian(System.Span destination, out int bytesWritten) { throw null; } + bool System.Numerics.IFloatingPoint.TryWriteSignificandLittleEndian(System.Span destination, out int bytesWritten) { throw null; } + static bool System.Numerics.INumberBase.IsCanonical(System.Numerics.Decimal32 value) { throw null; } + static bool System.Numerics.INumberBase.IsComplexNumber(System.Numerics.Decimal32 value) { throw null; } + static bool System.Numerics.INumberBase.IsImaginaryNumber(System.Numerics.Decimal32 value) { throw null; } + static bool System.Numerics.INumberBase.IsZero(System.Numerics.Decimal32 value) { throw null; } + static bool System.Numerics.INumberBase.TryConvertFromChecked(TOther value, out System.Numerics.Decimal32 result) { throw null; } + static bool System.Numerics.INumberBase.TryConvertFromSaturating(TOther value, out System.Numerics.Decimal32 result) { throw null; } + static bool System.Numerics.INumberBase.TryConvertFromTruncating(TOther value, out System.Numerics.Decimal32 result) { throw null; } + static bool System.Numerics.INumberBase.TryConvertToChecked(System.Numerics.Decimal32 value, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TOther result) { throw null; } + static bool System.Numerics.INumberBase.TryConvertToSaturating(System.Numerics.Decimal32 value, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TOther result) { throw null; } + static bool System.Numerics.INumberBase.TryConvertToTruncating(System.Numerics.Decimal32 value, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TOther result) { throw null; } + public override string ToString() { throw null; } + public string ToString(System.IFormatProvider? provider) { throw null; } + public string ToString([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("NumericFormat")] string? format) { throw null; } + public string ToString([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("NumericFormat")] string? format, System.IFormatProvider? provider) { throw null; } + public static System.Numerics.Decimal32 Truncate(System.Numerics.Decimal32 x) { throw null; } + public bool TryFormat(System.Span destination, out int charsWritten, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("NumericFormat")] System.ReadOnlySpan format = default(System.ReadOnlySpan), System.IFormatProvider? provider = null) { throw null; } + public static bool TryParse(System.ReadOnlySpan s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out System.Numerics.Decimal32 result) { throw null; } + public static bool TryParse(System.ReadOnlySpan s, System.IFormatProvider? provider, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out System.Numerics.Decimal32 result) { throw null; } + public static bool TryParse(System.ReadOnlySpan s, out System.Numerics.Decimal32 result) { throw null; } + public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out System.Numerics.Decimal32 result) { throw null; } + public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out System.Numerics.Decimal32 result) { throw null; } + public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.Numerics.Decimal32 result) { throw null; } + } } diff --git a/src/libraries/System.Runtime.Numerics/src/System.Runtime.Numerics.csproj b/src/libraries/System.Runtime.Numerics/src/System.Runtime.Numerics.csproj index 7634a2ce9d800b..49d9499a163f0d 100644 --- a/src/libraries/System.Runtime.Numerics/src/System.Runtime.Numerics.csproj +++ b/src/libraries/System.Runtime.Numerics/src/System.Runtime.Numerics.csproj @@ -1,10 +1,13 @@ - + System.Numerics true $(NetCoreAppCurrent) + + + @@ -22,12 +25,9 @@ - - - + + + diff --git a/src/libraries/System.Runtime.Numerics/src/System/Numerics/Decimal32.cs b/src/libraries/System.Runtime.Numerics/src/System/Numerics/Decimal32.cs new file mode 100644 index 00000000000000..96631677389049 --- /dev/null +++ b/src/libraries/System.Runtime.Numerics/src/System/Numerics/Decimal32.cs @@ -0,0 +1,1992 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using System.Globalization; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace System.Numerics +{ + /// + /// An IEEE 754 compliant decimal32 type. + /// + [StructLayout(LayoutKind.Sequential)] + public readonly struct Decimal32 + : IComparable, + IComparable, + ISpanFormattable, + ISpanParsable, + IEquatable, + IFloatingPoint, + /*IDecimalFloatingPointIeee754,*/ //PLATINUM + IMinMaxValue + { + + private const NumberStyles DefaultParseStyle = NumberStyles.Float | NumberStyles.AllowThousands; // TODO is this correct? + + // + // Constants for manipulating the private bit-representation + // + + internal const uint SignMask = 0x8000_0000; + internal const int SignShift = 31; + + internal const uint CombinationMask = 0x7FF0_0000; + internal const int CombinationShift = 20; + internal const int CombinationWidth = 11; + internal const ushort ShiftedCombinationMask = (ushort)(CombinationMask >> CombinationShift); + + internal const uint TrailingSignificandMask = 0x000F_FFFF; + internal const int TrailingSignificandWidth = 20; + + internal const sbyte EMax = 96; + internal const sbyte EMin = -95; + + internal const byte Precision = 7; + internal const byte ExponentBias = 101; + + internal const sbyte MaxQExponent = EMax - Precision + 1; + internal const sbyte MinQExponent = EMin - Precision + 1; + + internal const int MaxSignificand = 9999999; + internal const int MinSignificand = -9999999; + + // The 5 bits that classify the value as NaN, Infinite, or Finite + // If the Classification bits are set to 11111, the value is NaN + // If the Classification bits are set to 11110, the value is Infinite + // Otherwise, the value is Finite + internal const uint ClassificationMask = 0x7C00_0000; + internal const uint NaNMask = 0x7C00_0000; + internal const uint InfinityMask = 0x7800_0000; + + // If the Classification bits are set to 11XXX, we encode the significand one way. Otherwise, we encode it a different way + internal const uint SpecialEncodingMask = 0x6000_0000; + + // Finite significands are encoded in two different ways, depending on whether the most significant 4 bits of the significand are 0xxx or 100x. Test the MSB to classify. + internal const uint SignificandEncodingTypeMask = 1 << (TrailingSignificandWidth + 3); + + // Constants representing the private bit-representation for various default values. + // See either IEEE-754 2019 section 3.5 or https://en.wikipedia.org/wiki/Decimal32_floating-point_format for a breakdown of the encoding. + + // PositiveZero Bits + // Hex: 0x0000_0000 + // Binary: 0000_0000_0000_0000_0000_0000_0000_0000 + // Split into sections: 0 | 000_0000_0 | 000_0000_0000_0000_0000_0000 + // 0 | 0000_0000 | 000_0000_0000_0000_0000_0000 + // Section labels: a | b | c + // + // a. Sign bit. + // b. Biased Exponent, which is q + 101. 0000_0000 == 0 == -101 + 101, so this is encoding a q of -101. + // c. Significand, set to 0. + // + // Encoded value: 0 x 10^-101 + + private const uint PositiveZeroBits = 0x0000_0000; + private const uint NegativeZeroBits = SignMask | PositiveZeroBits; + + + // Epsilon Bits + // Hex: 0x0000_0001 + // Binary: 0000_0000_0000_0000_0000_0000_0000_0001 + // Split into sections: 0 | 000_0000_0 | 000_0000_0000_0000_0000_0001 + // 0 | 0000_0000 | 000_0000_0000_0000_0000_0001 + // Section labels: a | b | c + // + // a. Sign bit. + // b. Biased Exponent, which is q + 101. 0000_0000 == 0 == -101 + 101, so this is encoding a q of -101. + // c. Significand, set to 1. + // + // Encoded value: 1 x 10^-101 + + private const uint EpsilonBits = 0x0000_0001; + + // PositiveInfinityBits + // Hex: 0x7800_0000 + // Binary: 0111_1000_0000_0000_0000_0000_0000_0000 + // Split into sections: 0 | 111_1000_0000 | 0000_0000_0000_0000_0000 + // Section labels: a | b | c + // + // a. Sign bit. + // b. Combination field G0 through G10. G0-G4 == 11110 encodes infinity. + // c. Trailing significand. + // Note: Canonical infinity has everything after G5 set to 0. + + private const uint PositiveInfinityBits = 0x7800_0000; + private const uint NegativeInfinityBits = SignMask | PositiveInfinityBits; + + + // QNanBits + // Hex: 0x7C00_0000 + // Binary: 0111_1100_0000_0000_0000_0000_0000_0000 + // Split into sections: 0 | 111_1100_0000 | 0000_0000_0000_0000_0000 + // Section labels: a | b | c + // + // a. Sign bit (ignored for NaN). + // b. Combination field G0 through G10. G0-G4 == 11111 encodes NaN. + // c. Trailing significand. Can be used to encode a payload, to distinguish different NaNs. + // Note: Canonical NaN has G6-G10 as 0 and the encoding of the payload also canonical. + + private const uint QNanBits = 0x7C00_0000; // TODO I used a "positive" NaN here, should it be negative? + private const uint SNanBits = 0x7E00_0000; + + + // MaxValueBits + // Hex: 0x77F8_967F + // Binary: 0111_0111_1111_1000_1001_0110_0111_1111 + // Split into sections: 0 | 11 | 1_0111_111 | 1_1000_1001_0110_0111_1111 + // 0 | 11 | 1011_1111 | [100]1_1000_1001_0110_0111_1111 + // Section labels: a | b | c | d + // + // a. Sign bit. + // b. G0 and G1 of the combination field, "11" indicates this version of encoding. + // c. Biased Exponent, which is q + 101. 1011_1111 == 191 == 90 + 101, so this is encoding a q of 90. + // d. Significand. Section b. indicates an implied prefix of [100]. [100]1_1000_1001_0110_0111_1111 == 9,999,999. + // + // Encoded value: 9,999,999 x 10^90 + + private const uint MaxValueBits = 0x77F8_967F; + private const uint MinValueBits = SignMask | MaxValueBits; + + // PositiveOneBits Bits + // Hex: 0x3280_0001 + // Binary: 0011_0010_1000_0000_0000_0000_0000_0001 + // Split into sections: 0 | 011_0010_1 | 000_0000_0000_0000_0000_0001 + // 0 | 0110_0101 | 000_0000_0000_0000_0000_0001 + // Section labels: a | b | c + // + // a. Sign bit. + // b. Biased Exponent, which is q + 101. 0110_0101 == 101 == 0 + 101, so this is encoding a q of 0. + // c. Significand, set to 1. + // + // Encoded value: 1 x 10^0 + + private const uint PositiveOneBits = 0x3280_0001; + private const uint NegativeOneBits = SignMask | PositiveOneBits; + + /* + private const uint EBits = 0; // TODO + private const uint PiBits = 0; // TODO + private const uint TauBits = 0; // TODO*/ + + internal readonly uint _value; + + // + // Internal Constructors and Decoders + // + + internal Decimal32(uint value) + { + _value = value; + } + + // Constructs a Decimal32 representing a value in the form (-1)^s * 10^q * c, where + // * s is 0 or 1 + // * q is any integer MinQExponent <= q <= MaxQExponent + // * c is the significand represented by a digit string of the form + // `d0 d1 d2 ... dp-1`, where p is Precision. c is an integer with 0 <= c < 10^p. + internal Decimal32(bool sign, sbyte q, uint c) + { + Debug.Assert(q >= MinQExponent && q <= MaxQExponent); + Debug.Assert(q + ExponentBias >= 0); + Debug.Assert(c <= MaxSignificand); + + uint trailing_sig = c & TrailingSignificandMask; + + // Two types of combination encodings for finite numbers + uint combination = 0; + + if ((c & SignificandEncodingTypeMask) == 0) + { + // We are encoding a significand that has the most significand 4 bits set to 0xyz + combination |= (uint)(q + ExponentBias) << 3; + combination |= 0b0111 & (c >> TrailingSignificandWidth); // combination = (biased_exponent, xyz) + } + else + { + // We are encoding a significand that has the most significand 4 bits set to 100x + combination |= 0b11 << (CombinationWidth - 2); + combination |= (uint)(q + ExponentBias) << 1; + combination |= 0b0001 & (c >> CombinationShift); // combination = (11, biased_exponent, x) + } + + _value = ((sign ? 1U : 0U) << SignShift) + (combination << CombinationShift) + trailing_sig; + } + + internal byte BiasedExponent + { + get + { + uint bits = _value; + return ExtractBiasedExponentFromBits(bits); + } + } + + internal sbyte Exponent + { + get + { + return (sbyte)(BiasedExponent - ExponentBias); + } + } + + internal uint Significand + { + get + { + return ExtractSignificandFromBits(_value); + } + } + + internal uint TrailingSignificand + { + get + { + return _value & TrailingSignificandMask; + } + } + + // returns garbage for infinity and NaN, TODO maybe fix this + internal static byte ExtractBiasedExponentFromBits(uint bits) + { + ushort combination = (ushort)((bits >> CombinationShift) & ShiftedCombinationMask); + + // Two types of encodings for finite numbers + if ((bits & SpecialEncodingMask) == SpecialEncodingMask) + { + // G0 and G1 are 11, exponent is stored in G2:G(CombinationWidth - 1) + return (byte)(combination >> 1); + } + else + { + // G0 and G1 are not 11, exponent is stored in G0:G(CombinationWidth - 3) + return (byte)(combination >> 3); + } + } + + // returns garbage for infinity and NaN, TODO maybe fix this + internal static uint ExtractSignificandFromBits(uint bits) + { + ushort combination = (ushort)((bits >> CombinationShift) & ShiftedCombinationMask); + + // Two types of encodings for finite numbers + uint significand; + if ((bits & SpecialEncodingMask) == SpecialEncodingMask) + { + // G0 and G1 are 11, 4 MSBs of significand are 100x, where x is G(CombinationWidth) + significand = (uint)(0b1000 | (combination & 0b1)); + } + else + { + // G0 and G1 are not 11, 4 MSBs of significand are 0xyz, where G(CombinationWidth - 2):G(CombinationWidth) + significand = (uint)(combination & 0b111); + } + significand <<= TrailingSignificandWidth; + significand += bits & TrailingSignificandMask; + return significand; + } + + // IEEE 754 specifies NaNs to be propagated + internal static Decimal32 Negate(Decimal32 value) + { + return IsNaN(value) ? value : new Decimal32(value._value ^ SignMask); + } + + private static uint StripSign(Decimal32 value) + { + return value._value & ~SignMask; + } + + // + // Parsing (INumberBase, IParsable, ISpanParsable) + // + + /// + /// Parses a from a in the default parse style. + /// + /// The input to be parsed. + /// The equivalent value representing the input string. If the input exceeds Decimal32's range, a or is returned. + public static Decimal32 Parse(string s) + { + if (s == null) ThrowHelper.ThrowArgumentNullException("s"); + return IeeeDecimalNumber.ParseDecimal32(s, DefaultParseStyle, NumberFormatInfo.CurrentInfo); + } + + /// + /// Parses a from a in the given . + /// + /// The input to be parsed. + /// The used to parse the input. + /// The equivalent value representing the input string. If the input exceeds Decimal32's range, a or is returned. + public static Decimal32 Parse(string s, NumberStyles style) + { + IeeeDecimalNumber.ValidateParseStyleFloatingPoint(style); + if (s == null) ThrowHelper.ThrowArgumentNullException("s"); + return IeeeDecimalNumber.ParseDecimal32(s, style, NumberFormatInfo.CurrentInfo); + } + + /// + public static Decimal32 Parse(ReadOnlySpan s, IFormatProvider? provider) + { + IeeeDecimalNumber.ValidateParseStyleFloatingPoint(DefaultParseStyle); // TODO I copied this from NumberFormatInfo to IeeeDecimalNumber, is that ok? + return IeeeDecimalNumber.ParseDecimal32(s, DefaultParseStyle, NumberFormatInfo.GetInstance(provider)); + } + + /// + public static Decimal32 Parse(string s, IFormatProvider? provider) + { + if (s == null) ThrowHelper.ThrowArgumentNullException("s"); + return IeeeDecimalNumber.ParseDecimal32(s, DefaultParseStyle, NumberFormatInfo.GetInstance(provider)); + } + + /// + public static Decimal32 Parse(ReadOnlySpan s, NumberStyles style = DefaultParseStyle, IFormatProvider? provider = null) + { + IeeeDecimalNumber.ValidateParseStyleFloatingPoint(style); + return IeeeDecimalNumber.ParseDecimal32(s, style, NumberFormatInfo.GetInstance(provider)); + } + + /// + public static Decimal32 Parse(string s, NumberStyles style, IFormatProvider? provider) + { + IeeeDecimalNumber.ValidateParseStyleFloatingPoint(style); + if (s == null) ThrowHelper.ThrowArgumentNullException("s"); + return IeeeDecimalNumber.ParseDecimal32(s, style, NumberFormatInfo.GetInstance(provider)); + } + + /// + /// Tries to parse a from a in the default parse style. + /// + /// The input to be parsed. + /// The equivalent value representing the input string if the parse was successful. If the input exceeds Decimal32's range, a or is returned. If the parse was unsuccessful, a default value is returned. + /// if the parse was successful, otherwise. + public static bool TryParse([NotNullWhen(true)] string? s, out Decimal32 result) + { + if (s == null) + { + result = default; + return false; + } + return TryParse(s, DefaultParseStyle, provider: null, out result); + } + + /// + /// Tries to parse a from a in the default parse style. + /// + /// The input to be parsed. + /// The equivalent value representing the input string if the parse was successful. If the input exceeds Decimal32's range, a or is returned. If the parse was unsuccessful, a default value is returned. + /// if the parse was successful, otherwise. + public static bool TryParse(ReadOnlySpan s, out Decimal32 result) + { + return TryParse(s, DefaultParseStyle, provider: null, out result); + } + + /// + public static bool TryParse(ReadOnlySpan s, IFormatProvider? provider, [MaybeNullWhen(false)] out Decimal32 result) => TryParse(s, DefaultParseStyle, provider, out result); + + /// + public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, [MaybeNullWhen(false)] out Decimal32 result) => TryParse(s, DefaultParseStyle, provider, out result); + + /// + public static bool TryParse(ReadOnlySpan s, NumberStyles style, IFormatProvider? provider, [MaybeNullWhen(false)] out Decimal32 result) + { + IeeeDecimalNumber.ValidateParseStyleFloatingPoint(style); + return IeeeDecimalNumber.TryParseDecimal32(s, style, NumberFormatInfo.GetInstance(provider), out result); + } + + /// + public static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, [MaybeNullWhen(false)] out Decimal32 result) + { + IeeeDecimalNumber.ValidateParseStyleFloatingPoint(style); + + if (s == null) + { + result = Zero; + return false; + } + + return IeeeDecimalNumber.TryParseDecimal32(s, style, NumberFormatInfo.GetInstance(provider), out result); + } + + // + // Misc. Methods (IComparable, IEquatable) + // + + /// + /// Compares this object to another object, returning an integer that indicates the relationship. + /// + /// A value less than zero if this is less than , zero if this is equal to , or a value greater than zero if this is greater than . + /// Thrown when is not of type . + public int CompareTo(object? obj) => throw new NotImplementedException(); + + /// + /// Compares this object to another object, returning an integer that indicates the relationship. + /// + /// A value less than zero if this is less than , zero if this is equal to , or a value greater than zero if this is greater than . + public int CompareTo(Decimal32 other) => throw new NotImplementedException(); + + /// + /// Returns a value that indicates whether this instance is equal to a specified . + /// + public override bool Equals([NotNullWhen(true)] object? obj) + { + return (obj is Decimal32 other) && Equals(other); + } + + /// + /// Returns a value that indicates whether this instance is equal to a specified value. + /// + public bool Equals(Decimal32 other) + { + return this == other + || (IsNaN(this) && IsNaN(other)); + } + + /// + /// Serves as the default hash function. + /// + public override int GetHashCode() + { + // TODO we know that NaNs and Zeros should hash the same. Should values of the same cohort have the same hash? + throw new NotImplementedException(); + } + + // 5.5.2 of the IEEE Spec + [CLSCompliant(false)] + public static uint EncodeDecimal(Decimal32 x) => throw new NotImplementedException(); + [CLSCompliant(false)] + public static Decimal32 DecodeDecimal(uint x) => throw new NotImplementedException(); + [CLSCompliant(false)] + public static uint EncodeBinary(Decimal32 x) => throw new NotImplementedException(); + [CLSCompliant(false)] + public static Decimal32 DecodeBinary(uint x) => throw new NotImplementedException(); + + // + // Formatting (IFormattable, ISpanFormattable) + // + + /// + /// Returns a string representation of the current value. + /// + public override string ToString() + { + throw new NotImplementedException(); + } + + /// + /// Returns a string representation of the current value using the specified . + /// + public string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format) + { + throw new NotImplementedException(); + } + + /// + /// Returns a string representation of the current value with the specified . + /// + public string ToString(IFormatProvider? provider) + { + throw new NotImplementedException(); + } + + /// + /// Returns a string representation of the current value using the specified and . + /// + public string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format, IFormatProvider? provider) // TODO the interface calls this second param "formatProvider". Which do we want? + { + // Temporary Formatting for debugging + if (IsNaN(this)) + { + return "NaN"; + } + else if (IsPositiveInfinity(this)) + { + return "Infinity"; + } + else if (IsNegativeInfinity(this)) + { + return "-Infinity"; + } + + return (IsPositive(this) ? "" : "-") + Significand.ToString() + "E" + Exponent.ToString(); + } + + /// + /// Tries to format the value of the current Decimal32 instance into the provided span of characters. + /// + /// When this method returns, this instance's value formatted as a span of characters. + /// When this method returns, the number of characters that were written in . + /// A span containing the characters that represent a standard or custom format string that defines the acceptable format for . + /// An optional object that supplies culture-specific formatting information for . + /// + public bool TryFormat(Span destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan format = default, IFormatProvider? provider = null) + { + throw new NotImplementedException(); + } + + + // + // Explicit Convert To Decimal32 + // (T -> Decimal32 is lossy) + // + + /// Explicitly converts a value to its nearest representable 32-bit decimal floating-point value. + /// The value to convert. + /// converted to its nearest representable 32-bit decimal floating-point value. + [CLSCompliant(false)] + public static explicit operator Decimal32(int value) => throw new NotImplementedException(); + + /// Explicitly converts a value to its nearest representable 32-bit decimal floating-point value. + /// The value to convert. + /// converted to its nearest representable 32-bit decimal floating-point value. + [CLSCompliant(false)] + public static explicit operator Decimal32(uint value) => throw new NotImplementedException(); + + + /// Explicitly converts a value to its nearest representable 32-bit decimal floating-point value. + /// The value to convert. + /// converted to its nearest representable 32-bit decimal floating-point value. + public static explicit operator Decimal32(nint value) => throw new NotImplementedException(); + + /// Explicitly converts a value to its nearest representable 32-bit decimal floating-point value. + /// The value to convert. + /// converted to its nearest representable 32-bit decimal floating-point value. + [CLSCompliant(false)] + public static explicit operator Decimal32(nuint value) => throw new NotImplementedException(); + + /// Explicitly converts a value to its nearest representable 32-bit decimal floating-point value. + /// The value to convert. + /// converted to its nearest representable 32-bit decimal floating-point value. + public static explicit operator Decimal32(long value) => throw new NotImplementedException(); + + /// Explicitly converts a value to its nearest representable 32-bit decimal floating-point value. + /// The value to convert. + /// converted to its nearest representable 32-bit decimal floating-point value. + [CLSCompliant(false)] + public static explicit operator Decimal32(ulong value) => throw new NotImplementedException(); + + /// Explicitly converts a value to its nearest representable 32-bit decimal floating-point value. + /// The value to convert. + /// converted to its nearest representable 32-bit decimal floating-point value. + public static explicit operator Decimal32(Int128 value) => throw new NotImplementedException(); + + /// Explicitly converts a value to its nearest representable 32-bit decimal floating-point value. + /// The value to convert. + /// converted to its nearest representable 32-bit decimal floating-point value. + [CLSCompliant(false)] + public static explicit operator Decimal32(UInt128 value) => throw new NotImplementedException(); + + /// Explicitly converts a value to its nearest representable 32-bit decimal floating-point value. + /// The value to convert. + /// converted to its nearest representable 32-bit decimal floating-point value. + public static explicit operator Decimal32(Half value) => throw new NotImplementedException(); + + /// Explicitly converts a value to its nearest representable 32-bit decimal floating-point value. + /// The value to convert. + /// converted to its nearest representable 32-bit decimal floating-point value. + public static explicit operator Decimal32(float value) => throw new NotImplementedException(); + + /// Explicitly converts a value to its nearest representable 32-bit decimal floating-point value. + /// The value to convert. + /// converted to its nearest representable 32-bit decimal floating-point value. + public static explicit operator Decimal32(double value) => throw new NotImplementedException(); + + /// Explicitly converts a value to its nearest representable 32-bit decimal floating-point value. + /// The value to convert. + /// converted to its nearest representable 32-bit decimal floating-point value. + public static explicit operator Decimal32(decimal value) => throw new NotImplementedException(); + + // public static explicit operator Decimal32(Decimal64 value) => throw new NotImplementedException(); TODO + // public static explicit operator Decimal32(Decimal128 value) => throw new NotImplementedException(); TODO + + // + // Explicit Convert From Decimal32 + // (Decimal32 -> T is lossy) + // - Includes a "checked" conversion if T cannot represent infinity and NaN + // + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value. + /// The value to convert. + /// converted to its nearest representable value. + public static explicit operator byte(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value, throwing an overflow exception for any values that fall outside the representable range. + /// The value to convert. + /// converted to its nearest representable value. + /// is not representable by . + public static explicit operator checked byte(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value. + /// The value to convert. + /// converted to its nearest representable value. + [CLSCompliant(false)] + public static explicit operator sbyte(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value, throwing an overflow exception for any values that fall outside the representable range. + /// The value to convert. + /// converted to its nearest representable value. + /// is not representable by . + [CLSCompliant(false)] + public static explicit operator checked sbyte(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value. + /// The value to convert. + /// converted to its nearest representable value. + public static explicit operator char(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value, throwing an overflow exception for any values that fall outside the representable range. + /// The value to convert. + /// converted to its nearest representable value. + /// is not representable by . + public static explicit operator checked char(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value. + /// The value to convert. + /// converted to its nearest representable value. + public static explicit operator short(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value, throwing an overflow exception for any values that fall outside the representable range. + /// The value to convert. + /// converted to its nearest representable value. + /// is not representable by . + public static explicit operator checked short(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value. + /// The value to convert. + /// converted to its nearest representable value. + [CLSCompliant(false)] + public static explicit operator ushort(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value, throwing an overflow exception for any values that fall outside the representable range. + /// The value to convert. + /// converted to its nearest representable value. + /// is not representable by . + [CLSCompliant(false)] + public static explicit operator checked ushort(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value. + /// The value to convert. + /// converted to its nearest representable value. + public static explicit operator int(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value, throwing an overflow exception for any values that fall outside the representable range. + /// The value to convert. + /// converted to its nearest representable value. + /// is not representable by . + public static explicit operator checked int(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value. + /// The value to convert. + /// converted to its nearest representable value. + [CLSCompliant(false)] + public static explicit operator uint(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value, throwing an overflow exception for any values that fall outside the representable range. + /// The value to convert. + /// converted to its nearest representable value. + /// is not representable by . + [CLSCompliant(false)] + public static explicit operator checked uint(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value. + /// The value to convert. + /// converted to its nearest representable value. + public static explicit operator nint(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value, throwing an overflow exception for any values that fall outside the representable range. + /// The value to convert. + /// converted to its nearest representable value. + /// is not representable by . + public static explicit operator checked nint(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value. + /// The value to convert. + /// converted to its nearest representable value. + [CLSCompliant(false)] + public static explicit operator nuint(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value, throwing an overflow exception for any values that fall outside the representable range. + /// The value to convert. + /// converted to its nearest representable value. + /// is not representable by . + [CLSCompliant(false)] + public static explicit operator checked nuint(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value. + /// The value to convert. + /// converted to its nearest representable value. + public static explicit operator long(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value, throwing an overflow exception for any values that fall outside the representable range. + /// The value to convert. + /// converted to its nearest representable value. + /// is not representable by . + public static explicit operator checked long(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value. + /// The value to convert. + /// converted to its nearest representable value. + [CLSCompliant(false)] + public static explicit operator ulong(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value, throwing an overflow exception for any values that fall outside the representable range. + /// The value to convert. + /// converted to its nearest representable value. + /// is not representable by . + [CLSCompliant(false)] + public static explicit operator checked ulong(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value. + /// The value to convert. + /// converted to its nearest representable value. + public static explicit operator Int128(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value, throwing an overflow exception for any values that fall outside the representable range. + /// The value to convert. + /// converted to its nearest representable value. + /// is not representable by . + public static explicit operator checked Int128(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value. + /// The value to convert. + /// converted to its nearest representable value. + [CLSCompliant(false)] + public static explicit operator UInt128(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value, throwing an overflow exception for any values that fall outside the representable range. + /// The value to convert. + /// converted to its nearest representable value. + /// is not representable by . + [CLSCompliant(false)] + public static explicit operator checked UInt128(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value. + /// The value to convert. + /// converted to its nearest representable value. + public static explicit operator Half(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value. + /// The value to convert. + /// converted to its nearest representable value. + public static explicit operator float(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value. + /// The value to convert. + /// converted to its nearest representable value. + public static explicit operator double(Decimal32 value) => throw new NotImplementedException(); + + /// Explicitly converts a 32-bit decimal floating-point value to its nearest representable value. + /// The value to convert. + /// converted to its nearest representable value. + public static explicit operator decimal(Decimal32 value) => throw new NotImplementedException(); + + // + // Implicit Convert To Decimal32 + // (T -> Decimal32 is not lossy) + // + + /// Implicitly converts a value to its nearest representable 32-bit decimal floating-point value. + /// The value to convert. + /// converted to its nearest representable 32-bit decimal floating-point value. + public static implicit operator Decimal32(byte value) => throw new NotImplementedException(); + + /// Implicitly converts a value to its nearest representable 32-bit decimal floating-point value. + /// The value to convert. + /// converted to its nearest representable 32-bit decimal floating-point value. + [CLSCompliant(false)] + public static implicit operator Decimal32(sbyte value) => throw new NotImplementedException(); + + /// Implicitly converts a value to its nearest representable 32-bit decimal floating-point value. + /// The value to convert. + /// converted to its nearest representable 32-bit decimal floating-point value. + public static implicit operator Decimal32(char value) => throw new NotImplementedException(); + + /// Implicitly converts a value to its nearest representable 32-bit decimal floating-point value. + /// The value to convert. + /// converted to its nearest representable 32-bit decimal floating-point value. + public static implicit operator Decimal32(short value) => throw new NotImplementedException(); + + /// Implicitly converts a value to its nearest representable 32-bit decimal floating-point value. + /// The value to convert. + /// converted to its nearest representable 32-bit decimal floating-point value. + [CLSCompliant(false)] + public static implicit operator Decimal32(ushort value) => throw new NotImplementedException(); + + // + // Implicit Convert From Decimal32 + // (Decimal32 -> T is not lossy) + // + + // public static implicit operator Decimal64(Decimal32 value) => throw new NotImplementedException(); TODO + // public static implicit operator Decimal128(Decimal32 value) => throw new NotImplementedException(); TODO + + // + // IAdditionOperators + // + + /// + public static Decimal32 operator +(Decimal32 left, Decimal32 right) => throw new NotImplementedException(); + + // + // IAdditiveIdentity + // + + /// + static Decimal32 IAdditiveIdentity.AdditiveIdentity => new Decimal32(PositiveZeroBits); // TODO make sure this is a zero such that the quantum of any other value is preserved on addition + + + // + // IComparisonOperators + // + + /// + public static bool operator <(Decimal32 left, Decimal32 right) => throw new NotImplementedException(); + + /// + public static bool operator >(Decimal32 left, Decimal32 right) => throw new NotImplementedException(); + + /// + public static bool operator <=(Decimal32 left, Decimal32 right) => throw new NotImplementedException(); + + /// + public static bool operator >=(Decimal32 left, Decimal32 right) => throw new NotImplementedException(); + + // + // IDecimalFloatingPointIeee754 + // + + /// + public static Decimal32 Quantize(Decimal32 x, Decimal32 y) + { + throw new NotImplementedException(); + } + + /// + public static Decimal32 Quantum(Decimal32 x) => throw new NotImplementedException(); + + /// + public static bool SameQuantum(Decimal32 x, Decimal32 y) + { + return x.Exponent == y.Exponent + || (IsInfinity(x) && IsInfinity(y)) + || (IsNaN(x) && IsNaN(y)); + } + + // + // IDecrementOperators + // + + /// + public static Decimal32 operator --(Decimal32 value) => throw new NotImplementedException(); + + // + // IDivisionOperators + // + + /// + public static Decimal32 operator /(Decimal32 left, Decimal32 right) => throw new NotImplementedException(); + + // + // IEqualityOperators + // + + // Fast access for 10^n where n is 0:(Precision - 1) + private static readonly uint[] s_powers10 = new uint[] { + 1, + 10, + 100, + 1000, + 10000, + 100000, + 1000000 + }; + + /// + public static bool operator ==(Decimal32 left, Decimal32 right) // TODO we can probably do this faster + { + if (IsNaN(left) || IsNaN(right)) + { + // IEEE defines that NaN is not equal to anything, including itself. + return false; + } + + if (IsZero(left) && IsZero(right)) + { + // IEEE defines that positive and negative zero are equivalent. + return true; + } + + bool sameSign = IsPositive(left) == IsPositive(right); + + if (IsInfinity(left) || IsInfinity(right)) + { + if (IsInfinity(left) && IsInfinity(right) && sameSign) + { + return true; + } + else + { + return false; + } + } + + // IEEE defines that two values of the same cohort are numerically equivalent + + uint leftSignificand = left.Significand; + uint rightSignificand = right.Significand; + sbyte leftQ = left.Exponent; + sbyte rightQ = right.Exponent; + int diffQ = leftQ - rightQ; + + bool sameNumericalValue = false; + if (int.Abs(diffQ) < Precision) // If diffQ is >= Precision, the non-zero finite values have exponents too far apart for them to possibly be equal + { + try + { + if (diffQ < 0) + { + // leftQ is smaller than rightQ, scale leftSignificand + leftSignificand = checked(leftSignificand * s_powers10[int.Abs(diffQ)]); + } + else + { + // rightQ is smaller than (or equal to) leftQ, scale rightSignificand + rightSignificand = checked(rightSignificand * s_powers10[diffQ]); + } + } + catch + { + // multiplication overflowed, return false + return false; + } + + if (leftSignificand == rightSignificand) + { + sameNumericalValue = true; + } + } + + return sameNumericalValue && sameSign; + } + + /// + public static bool operator !=(Decimal32 left, Decimal32 right) => throw new NotImplementedException(); + + // + // IExponentialFunctions PLATINUM + // + +/* /// + public static Decimal32 Exp(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 ExpM1(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 Exp2(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 Exp2M1(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 Exp10(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 Exp10M1(Decimal32 x) => throw new NotImplementedException();*/ + + // + // IFloatingPoint + // + + /// + public static Decimal32 Ceiling(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 Floor(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 Round(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 Round(Decimal32 x, int digits) => throw new NotImplementedException(); + + /// + public static Decimal32 Round(Decimal32 x, MidpointRounding mode) => throw new NotImplementedException(); + + /// + public static Decimal32 Round(Decimal32 x, int digits, MidpointRounding mode) => throw new NotImplementedException(); + + /// + public static Decimal32 Truncate(Decimal32 x) => throw new NotImplementedException(); + + /// + int IFloatingPoint.GetExponentByteCount() => throw new NotImplementedException(); + + /// + int IFloatingPoint.GetExponentShortestBitLength() => throw new NotImplementedException(); + + /// + int IFloatingPoint.GetSignificandBitLength() => throw new NotImplementedException(); + + /// + int IFloatingPoint.GetSignificandByteCount() => throw new NotImplementedException(); + + /// + bool IFloatingPoint.TryWriteExponentBigEndian(Span destination, out int bytesWritten) => throw new NotImplementedException(); + + /// + bool IFloatingPoint.TryWriteExponentLittleEndian(Span destination, out int bytesWritten) => throw new NotImplementedException(); + + /// + bool IFloatingPoint.TryWriteSignificandBigEndian(Span destination, out int bytesWritten) => throw new NotImplementedException(); + + /// + bool IFloatingPoint.TryWriteSignificandLittleEndian(Span destination, out int bytesWritten) => throw new NotImplementedException(); + + // + // IFloatingPointConstants + // + + /// + public static Decimal32 E => throw new NotImplementedException(); + + /// + public static Decimal32 Pi => throw new NotImplementedException(); + + /// + public static Decimal32 Tau => throw new NotImplementedException(); + + // + // IFloatingPointIeee754 + // + + /// + public static Decimal32 Epsilon => new Decimal32(EpsilonBits); // 1E-101 + + /// + public static Decimal32 NaN => new Decimal32(QNanBits); // 0.0 / 0.0 + + /// + public static Decimal32 NegativeInfinity => new Decimal32(NegativeInfinityBits); // -1.0 / 0.0 + + /// + public static Decimal32 NegativeZero => new Decimal32(NegativeZeroBits); // -0E-101 + + /// + public static Decimal32 PositiveInfinity => new Decimal32(PositiveInfinityBits); // 1.0 / 0.0 + +/* /// + public static Decimal32 Atan2(Decimal32 y, Decimal32 x) => throw new NotImplementedException(); // PLATINUM + + /// + public static Decimal32 Atan2Pi(Decimal32 y, Decimal32 x) => throw new NotImplementedException();*/ // PLATINUM + + /// + public static Decimal32 BitDecrement(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 BitIncrement(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 FusedMultiplyAdd(Decimal32 left, Decimal32 right, Decimal32 addend) => throw new NotImplementedException(); + + /// + public static Decimal32 Ieee754Remainder(Decimal32 left, Decimal32 right) => throw new NotImplementedException(); + + /// + public static int ILogB(Decimal32 x) => throw new NotImplementedException(); + + // /// + public static Decimal32 Lerp(Decimal32 value1, Decimal32 value2, Decimal32 amount) => throw new NotImplementedException(); + + /// + public static Decimal32 ReciprocalEstimate(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 ReciprocalSqrtEstimate(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 ScaleB(Decimal32 x, int n) => throw new NotImplementedException(); + + // /// + // public static Decimal32 Compound(Half x, Decimal32 n) => throw new NotImplementedException(); // PLATINUM + + // + // IHyperbolicFunctions PLATINUM + // + +/* /// + public static Decimal32 Acosh(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 Asinh(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 Atanh(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 Cosh(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 Sinh(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 Tanh(Decimal32 x) => throw new NotImplementedException();*/ + + // + // IIncrementOperators + // + + /// + public static Decimal32 operator ++(Decimal32 value) => throw new NotImplementedException(); + + // + // ILogarithmicFunctions PLATINUM + // + +/* /// + public static Decimal32 Log(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 Log(Decimal32 x, Decimal32 newBase) => throw new NotImplementedException(); + + /// + public static Decimal32 Log10(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 LogP1(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 Log2(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 Log2P1(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 Log10P1(Decimal32 x) => throw new NotImplementedException();*/ + + // + // IMinMaxValue + // + + /// + public static Decimal32 MaxValue => new Decimal32(MaxValueBits); // 9.999999E90 + + /// + public static Decimal32 MinValue => new Decimal32(MinValueBits); // -9.999999E90 + + // + // IModulusOperators + // + + /// + public static Decimal32 operator %(Decimal32 left, Decimal32 right) => throw new NotImplementedException(); + + // + // IMultiplicativeIdentity + // + + /// + public static Decimal32 MultiplicativeIdentity => new Decimal32(PositiveZeroBits); // TODO make sure this is a zero such that the quantum of any other value is preserved on multiplication + + // + // IMultiplyOperators + // + + /// + public static Decimal32 operator *(Decimal32 left, Decimal32 right) => throw new NotImplementedException(); + + // + // INumber + // + + /// + public static Decimal32 Clamp(Decimal32 value, Decimal32 min, Decimal32 max) => throw new NotImplementedException(); + + /// + public static Decimal32 CopySign(Decimal32 value, Decimal32 sign) => throw new NotImplementedException(); + + /// + public static Decimal32 Max(Decimal32 x, Decimal32 y) => throw new NotImplementedException(); + + /// + public static Decimal32 MaxNumber(Decimal32 x, Decimal32 y) => throw new NotImplementedException(); + + /// + public static Decimal32 Min(Decimal32 x, Decimal32 y) => throw new NotImplementedException(); + + /// + public static Decimal32 MinNumber(Decimal32 x, Decimal32 y) => throw new NotImplementedException(); + + /// + public static int Sign(Decimal32 value) => throw new NotImplementedException(); + + + // + // INumberBase (well defined/commonly used values) + // + + /// + public static Decimal32 One => new Decimal32(PositiveOneBits); // 1E0 + + /// + static int INumberBase.Radix => 10; // TODO this should be exposed implicitly as it is required by IEEE + + /// + public static Decimal32 Zero => new Decimal32(PositiveZeroBits); // -0E-101 + + /// + public static Decimal32 Abs(Decimal32 value) + { + return new Decimal32(value._value & ~SignMask); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Decimal32 CreateChecked(TOther value) + where TOther : INumberBase + { + Decimal32 result; + + if (typeof(TOther) == typeof(Decimal32)) + { + result = (Decimal32)(object)value; + } + else if (!TryConvertFromChecked(value, out result) && !TOther.TryConvertToChecked(value, out result)) + { + ThrowHelper.ThrowNotSupportedException(); + } + + return result; + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Decimal32 CreateSaturating(TOther value) + where TOther : INumberBase + { + Decimal32 result; + + if (typeof(TOther) == typeof(Decimal32)) + { + result = (Decimal32)(object)value; + } + else if (!TryConvertFromSaturating(value, out result) && !TOther.TryConvertToSaturating(value, out result)) + { + ThrowHelper.ThrowNotSupportedException(); + } + + return result; + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Decimal32 CreateTruncating(TOther value) + where TOther : INumberBase + { + Decimal32 result; + + if (typeof(TOther) == typeof(Decimal32)) + { + result = (Decimal32)(object)value; + } + else if (!TryConvertFromTruncating(value, out result) && !TOther.TryConvertToTruncating(value, out result)) + { + ThrowHelper.ThrowNotSupportedException(); + } + + return result; + } + + /// + static bool INumberBase.IsCanonical(Decimal32 value) => throw new NotImplementedException(); // TODO this should be exposed implicitly as it is required by IEEE + + /// + static bool INumberBase.IsComplexNumber(Decimal32 value) => throw new NotImplementedException(); + + /// + public static bool IsEvenInteger(Decimal32 value) => throw new NotImplementedException(); + + /// + public static bool IsFinite(Decimal32 value) + { + return StripSign(value) < PositiveInfinityBits; + } + + /// + static bool INumberBase.IsImaginaryNumber(Decimal32 value) => throw new NotImplementedException(); + + /// + public static bool IsInfinity(Decimal32 value) + { + return (value._value & ClassificationMask) == InfinityMask; + } + + /// + public static bool IsInteger(Decimal32 value) => throw new NotImplementedException(); + + /// + public static bool IsNaN(Decimal32 value) + { + return (value._value & ClassificationMask) == NaNMask; + } + + /// + public static bool IsNegative(Decimal32 value) + { + return (int)(value._value) < 0; + } + + /// + public static bool IsNegativeInfinity(Decimal32 value) + { + return IsInfinity(value) && IsNegative(value); + } + + /// + public static bool IsNormal(Decimal32 value) => throw new NotImplementedException(); + + /// + public static bool IsOddInteger(Decimal32 value) => throw new NotImplementedException(); + + /// + public static bool IsPositive(Decimal32 value) + { + return (int)(value._value) >= 0; + } + + /// + public static bool IsPositiveInfinity(Decimal32 value) + { + return IsInfinity(value) && IsPositive(value); + } + + /// + public static bool IsRealNumber(Decimal32 value) => throw new NotImplementedException(); + + /// + public static bool IsSubnormal(Decimal32 value) => throw new NotImplementedException(); + + /// + static bool INumberBase.IsZero(Decimal32 value) // TODO this should be exposed implicitly as it is required by IEEE (see private function below) + { + return value.Significand == 0; + } + + private static bool IsZero(Decimal32 value) + { + return value.Significand == 0; + } + + /// + public static Decimal32 MaxMagnitude(Decimal32 x, Decimal32 y) => throw new NotImplementedException(); + + /// + public static Decimal32 MaxMagnitudeNumber(Decimal32 x, Decimal32 y) => throw new NotImplementedException(); + + /// + public static Decimal32 MinMagnitude(Decimal32 x, Decimal32 y) => throw new NotImplementedException(); + + /// + public static Decimal32 MinMagnitudeNumber(Decimal32 x, Decimal32 y) => throw new NotImplementedException(); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static bool INumberBase.TryConvertFromChecked(TOther value, out Decimal32 result) => TryConvertFromChecked(value, out result); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] +#pragma warning disable IDE0060 // Remove unused parameter + private static bool TryConvertFromChecked(TOther value, out Decimal32 result) +#pragma warning restore IDE0060 // Remove unused parameter + where TOther : INumberBase + { + if (typeof(TOther) == typeof(byte)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(char)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(decimal)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(double)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(Half)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(short)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(int)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(long)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(Int128)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(nint)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(sbyte)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(float)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(ushort)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(uint)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(ulong)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(UInt128)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(nuint)) + { + throw new NotImplementedException(); + } + else + { + result = default; + return false; + } + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static bool INumberBase.TryConvertFromSaturating(TOther value, out Decimal32 result) => TryConvertFromSaturating(value, out result); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] +#pragma warning disable IDE0060 // Remove unused parameter + private static bool TryConvertFromSaturating(TOther value, out Decimal32 result) +#pragma warning restore IDE0060 // Remove unused parameter + where TOther : INumberBase + { + if (typeof(TOther) == typeof(byte)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(char)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(decimal)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(double)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(Half)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(short)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(int)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(long)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(Int128)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(nint)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(sbyte)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(float)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(ushort)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(uint)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(ulong)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(UInt128)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(nuint)) + { + throw new NotImplementedException(); + } + else + { + result = default; + return false; + } + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static bool INumberBase.TryConvertFromTruncating(TOther value, out Decimal32 result) => TryConvertFromTruncating(value, out result); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] +#pragma warning disable IDE0060 // Remove unused parameter TODO remove this + private static bool TryConvertFromTruncating(TOther value, out Decimal32 result) +#pragma warning restore IDE0060 // Remove unused parameter + where TOther : INumberBase + { + if (typeof(TOther) == typeof(byte)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(char)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(decimal)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(double)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(Half)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(short)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(int)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(long)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(Int128)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(nint)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(sbyte)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(float)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(ushort)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(uint)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(ulong)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(UInt128)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(nuint)) + { + throw new NotImplementedException(); + } + else + { + result = default; + return false; + } + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static bool INumberBase.TryConvertToChecked(Decimal32 value, [MaybeNullWhen(false)] out TOther result) + { + if (typeof(TOther) == typeof(byte)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(char)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(decimal)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(double)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(Half)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(short)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(int)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(long)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(Int128)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(nint)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(sbyte)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(float)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(ushort)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(uint)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(ulong)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(UInt128)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(nuint)) + { + throw new NotImplementedException(); + } + else + { + result = default; + return false; + } + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static bool INumberBase.TryConvertToSaturating(Decimal32 value, [MaybeNullWhen(false)] out TOther result) + { + if (typeof(TOther) == typeof(byte)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(char)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(decimal)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(double)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(Half)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(short)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(int)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(long)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(Int128)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(nint)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(Complex)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(sbyte)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(float)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(ushort)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(uint)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(ulong)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(UInt128)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(nuint)) + { + throw new NotImplementedException(); + } + else + { + result = default; + return false; + } + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static bool INumberBase.TryConvertToTruncating(Decimal32 value, [MaybeNullWhen(false)] out TOther result) + { + if (typeof(TOther) == typeof(byte)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(char)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(decimal)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(double)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(Half)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(short)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(int)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(long)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(Int128)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(nint)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(Complex)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(sbyte)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(float)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(ushort)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(uint)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(ulong)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(UInt128)) + { + throw new NotImplementedException(); + } + else if (typeof(TOther) == typeof(nuint)) + { + throw new NotImplementedException(); + } + else + { + result = default; + return false; + } + } + + // + // IPowerFunctions // PLATINUM + // + + /*/// + public static Decimal32 Pow(Decimal32 x, Decimal32 y) => throw new NotImplementedException();*/ + + // + // IRootFunctions + // + + /*/// + public static Decimal32 Cbrt(Decimal32 x) => throw new NotImplementedException(); // PLATINUM + + /// + public static Decimal32 Hypot(Decimal32 x, Decimal32 y) => throw new NotImplementedException(); // PLATINUM + + + /// + public static Decimal32 RootN(Decimal32 x, int n) => throw new NotImplementedException();*/ // PLATINUM + + /// + public static Decimal32 Sqrt(Decimal32 x) => throw new NotImplementedException(); + + // + // ISignedNumber + // + + /// + public static Decimal32 NegativeOne => new Decimal32(NegativeOneBits); // -1E0 + + // + // ISubtractionOperators + // + + /// + public static Decimal32 operator -(Decimal32 left, Decimal32 right) => throw new NotImplementedException(); + + // + // ITrigonometricFunctions PLATINUM + // + +/* /// + public static Decimal32 Acos(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 AcosPi(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 Asin(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 AsinPi(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 Atan(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 AtanPi(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 Cos(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 CosPi(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 Sin(Decimal32 x) => throw new NotImplementedException(); + + /// + public static (Decimal32 Sin, Decimal32 Cos) SinCos(Decimal32 x) => throw new NotImplementedException(); + + /// + public static (Decimal32 SinPi, Decimal32 CosPi) SinCosPi(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 SinPi(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 Tan(Decimal32 x) => throw new NotImplementedException(); + + /// + public static Decimal32 TanPi(Decimal32 x) => throw new NotImplementedException();*/ + + // + // IUnaryNegationOperators + // + + /// + public static Decimal32 operator -(Decimal32 value) => Negate(value); + + // + // IUnaryPlusOperators + // + + /// + public static Decimal32 operator +(Decimal32 value) => value; + } +} diff --git a/src/libraries/System.Runtime.Numerics/src/System/Numerics/IDecimalFloatingPointIeee754.cs b/src/libraries/System.Runtime.Numerics/src/System/Numerics/IDecimalFloatingPointIeee754.cs new file mode 100644 index 00000000000000..2473438f13a9ff --- /dev/null +++ b/src/libraries/System.Runtime.Numerics/src/System/Numerics/IDecimalFloatingPointIeee754.cs @@ -0,0 +1,26 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System.Numerics +{ + /// Defines an IEEE 754 floating-point type that is represented in a base-10 format. + /// The type that implements the interface. + internal interface IDecimalFloatingPointIeee754 // TODO make this public eventually + : IFloatingPointIeee754 + where TSelf : IDecimalFloatingPointIeee754 + { + // 5.3.2 + static abstract TSelf Quantize(TSelf x, TSelf y); + static abstract TSelf Quantum(TSelf x); + + // 5.5.2 + // Maybe expose this on this interface + /* TOther EncodeDecimal(TSelf x); + TSelf DecodeDecimal(TOther x); + TOther EncodeBinary(TSelf x); + TSelf DecodeBinary(TOther x);*/ + + // 5.7.3 + static abstract bool SameQuantum(TSelf x, TSelf y); + } +} diff --git a/src/libraries/System.Runtime.Numerics/src/System/Numerics/IeeeDecimalNumber.Parsing.cs b/src/libraries/System.Runtime.Numerics/src/System/Numerics/IeeeDecimalNumber.Parsing.cs new file mode 100644 index 00000000000000..5319e28ee8caf2 --- /dev/null +++ b/src/libraries/System.Runtime.Numerics/src/System/Numerics/IeeeDecimalNumber.Parsing.cs @@ -0,0 +1,703 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// The IeeeDecimalNumber class implements methods for formatting and parsing IEEE decimal types. +// If these types lived in the System namespace, these methods would live in Number.Parsing.cs and Number.Formatting.cs, +// just like Single, Double, and Half. + +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using System.Globalization; +using System.Runtime.InteropServices; +using System.Text; +using System.Runtime.CompilerServices; + +namespace System.Numerics +{ + internal static partial class IeeeDecimalNumber + { + // IeeeDecimalNumberBuffer + + internal const int Decimal32BufferLength = 112 + 1 + 1; // TODO: X for the longest input + 1 for rounding (+1 for the null terminator). I just picked 112 cause that's what Single does for now. + + internal unsafe ref struct IeeeDecimalNumberBuffer + { + public int DigitsCount; + public int Scale; + public bool IsNegative; + public bool HasNonZeroTail; + public Span Digits; + + public IeeeDecimalNumberBuffer(byte* digits, int digitsLength) : this(new Span(digits, digitsLength)) + { + Debug.Assert(digits != null); + } + + /// Initializes the NumberBuffer. + /// The digits scratch space. The referenced memory must not be movable, e.g. stack memory, pinned array, etc. + public IeeeDecimalNumberBuffer(Span digits) + { + Debug.Assert(!digits.IsEmpty); + + DigitsCount = 0; + Scale = 0; + IsNegative = false; + HasNonZeroTail = false; + Digits = digits; +#if DEBUG + Digits.Fill(0xCC); +#endif + Digits[0] = (byte)'\0'; + CheckConsistency(); + } + + [Conditional("DEBUG")] + public void CheckConsistency() + { +#if DEBUG + Debug.Assert(Digits[0] != '0', "Leading zeros should never be stored in an IeeeDecimalNumber"); + + int numDigits; + for (numDigits = 0; numDigits < Digits.Length; numDigits++) + { + byte digit = Digits[numDigits]; + + if (digit == 0) + { + break; + } + + Debug.Assert(char.IsAsciiDigit((char)digit), $"Unexpected character found in IeeeDecimalNumber: {digit}"); + } + + Debug.Assert(numDigits == DigitsCount, "Null terminator found in unexpected location in IeeeDecimalNumber"); + Debug.Assert(numDigits < Digits.Length, "Null terminator not found in IeeeDecimalNumber"); +#endif // DEBUG + } + + public byte* GetDigitsPointer() + { + // This is safe to do since we are a ref struct + return (byte*)(Unsafe.AsPointer(ref Digits[0])); + } + + // + // Code coverage note: This only exists so that IeeeDecimalNumber displays nicely in the VS watch window. So yes, I know it works. + // + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + + sb.Append('['); + sb.Append('"'); + + for (int i = 0; i < Digits.Length; i++) + { + byte digit = Digits[i]; + + if (digit == 0) + { + break; + } + + sb.Append((char)(digit)); + } + + sb.Append('"'); + sb.Append(", Length = ").Append(DigitsCount); + sb.Append(", Scale = ").Append(Scale); + sb.Append(", IsNegative = ").Append(IsNegative); + sb.Append(", HasNonZeroTail = ").Append(HasNonZeroTail); + sb.Append(']'); + + return sb.ToString(); + } + } + + // IeeeDecimalNumber Parsing + + // The Parse methods provided by the numeric classes convert a + // string to a numeric value. The optional style parameter specifies the + // permitted style of the numeric string. It must be a combination of bit flags + // from the NumberStyles enumeration. The optional info parameter + // specifies the NumberFormatInfo instance to use when parsing the + // string. If the info parameter is null or omitted, the numeric + // formatting information is obtained from the current culture. + // + // Numeric strings produced by the Format methods using the Currency, + // Decimal, Engineering, Fixed point, General, or Number standard formats + // (the C, D, E, F, G, and N format specifiers) are guaranteed to be parseable + // by the Parse methods if the NumberStyles. Any style is + // specified. Note, however, that the Parse methods do not accept + // NaNs or Infinities. + + // Max and Min Exponent assuming the value is in the form 0.Mantissa x 10^Exponent + private const int Decimal32MaxExponent = Decimal32.MaxQExponent + Decimal32.Precision; // TODO check this + private const int Decimal32MinExponent = Decimal32.MinQExponent + Decimal32.Precision; // TODO check this, possibly wrong + + [DoesNotReturn] + internal static void ThrowFormatException(ReadOnlySpan value) => throw new FormatException(/*SR.Format(SR.Format_InvalidStringWithValue,*/ value.ToString()/*)*/); // TODO get this to work + + internal static Decimal32 ParseDecimal32(ReadOnlySpan value, NumberStyles styles, NumberFormatInfo info) + { + if (!TryParseDecimal32(value, styles, info, out Decimal32 result)) + { + ThrowFormatException(value); + } + + return result; + } + + internal static unsafe bool TryParseDecimal32(ReadOnlySpan value, NumberStyles styles, NumberFormatInfo info, out Decimal32 result) + { + IeeeDecimalNumberBuffer number = new IeeeDecimalNumberBuffer(stackalloc byte[Decimal32BufferLength]); + + if (!TryStringToNumber(value, styles, ref number, info)) + { + ReadOnlySpan valueTrim = value.Trim(); + + // This code would be simpler if we only had the concept of `InfinitySymbol`, but + // we don't so we'll check the existing cases first and then handle `PositiveSign` + + // `PositiveInfinitySymbol` and `PositiveSign/NegativeSign` + `NaNSymbol` last. + // + // Additionally, since some cultures ("wo") actually define `PositiveInfinitySymbol` + // to include `PositiveSign`, we need to check whether `PositiveInfinitySymbol` fits + // that case so that we don't start parsing things like `++infini`. + + if (valueTrim.Equals(info.PositiveInfinitySymbol, StringComparison.OrdinalIgnoreCase)) + { + result = Decimal32.PositiveInfinity; + } + else if (valueTrim.Equals(info.NegativeInfinitySymbol, StringComparison.OrdinalIgnoreCase)) + { + result = Decimal32.NegativeInfinity; + } + else if (valueTrim.Equals(info.NaNSymbol, StringComparison.OrdinalIgnoreCase)) + { + result = Decimal32.NaN; + } + else if (valueTrim.StartsWith(info.PositiveSign, StringComparison.OrdinalIgnoreCase)) + { + valueTrim = valueTrim.Slice(info.PositiveSign.Length); + + if (!info.PositiveInfinitySymbol.StartsWith(info.PositiveSign, StringComparison.OrdinalIgnoreCase) && valueTrim.Equals(info.PositiveInfinitySymbol, StringComparison.OrdinalIgnoreCase)) + { + result = Decimal32.PositiveInfinity; + } + else if (!info.NaNSymbol.StartsWith(info.PositiveSign, StringComparison.OrdinalIgnoreCase) && valueTrim.Equals(info.NaNSymbol, StringComparison.OrdinalIgnoreCase)) + { + result = Decimal32.NaN; + } + else + { + result = Decimal32.Zero; + return false; + } + } + else if (valueTrim.StartsWith(info.NegativeSign, StringComparison.OrdinalIgnoreCase) && + !info.NaNSymbol.StartsWith(info.NegativeSign, StringComparison.OrdinalIgnoreCase) && + valueTrim.Slice(info.NegativeSign.Length).Equals(info.NaNSymbol, StringComparison.OrdinalIgnoreCase)) + { + result = Decimal32.NaN; + } + else if (info.AllowHyphenDuringParsing && SpanStartsWith(valueTrim, '-') && !info.NaNSymbol.StartsWith(info.NegativeSign, StringComparison.OrdinalIgnoreCase) && + !info.NaNSymbol.StartsWith('-') && valueTrim.Slice(1).Equals(info.NaNSymbol, StringComparison.OrdinalIgnoreCase)) + { + result = Decimal32.NaN; + } + else + { + result = Decimal32.Zero; + return false; // We really failed + } + } + else + { + result = NumberToDecimal32(ref number); + } + + return true; + } + + internal static bool SpanStartsWith(ReadOnlySpan span, char c) => !span.IsEmpty && span[0] == c; + + internal static unsafe bool TryStringToNumber(ReadOnlySpan value, NumberStyles styles, ref IeeeDecimalNumberBuffer number, NumberFormatInfo info) + { + Debug.Assert(info != null); + fixed (char* stringPointer = &MemoryMarshal.GetReference(value)) + { + char* p = stringPointer; + if (!TryParseNumber(ref p, p + value.Length, styles, ref number, info) + || ((int)(p - stringPointer) < value.Length && !TrailingZeros(value, (int)(p - stringPointer)))) + { + number.CheckConsistency(); + return false; + } + } + + number.CheckConsistency(); + return true; + } + + [MethodImpl(MethodImplOptions.NoInlining)] // rare slow path that shouldn't impact perf of the main use case + private static bool TrailingZeros(ReadOnlySpan value, int index) => + // For compatibility, we need to allow trailing zeros at the end of a number string + value.Slice(index).IndexOfAnyExcept('\0') < 0; + + // Note: this is copy pasted and adjusted from Number.Parsing.cs in System.Private.CoreLib + private static unsafe bool TryParseNumber(scoped ref char* str, char* strEnd, NumberStyles styles, ref IeeeDecimalNumberBuffer number, NumberFormatInfo info) + { + Debug.Assert(str != null); + Debug.Assert(strEnd != null); + Debug.Assert(str <= strEnd); + Debug.Assert((styles & NumberStyles.AllowHexSpecifier) == 0); + + const int StateSign = 0x0001; + const int StateParens = 0x0002; + const int StateDigits = 0x0004; + const int StateNonZero = 0x0008; + const int StateDecimal = 0x0010; + const int StateCurrency = 0x0020; + + Debug.Assert(number.DigitsCount == 0); + Debug.Assert(number.Scale == 0); + Debug.Assert(!number.IsNegative); + Debug.Assert(!number.HasNonZeroTail); + + number.CheckConsistency(); + + string decSep; // decimal separator from NumberFormatInfo. + string groupSep; // group separator from NumberFormatInfo. + string? currSymbol = null; // currency symbol from NumberFormatInfo. + + bool parsingCurrency = false; + if ((styles & NumberStyles.AllowCurrencySymbol) != 0) + { + currSymbol = info.CurrencySymbol; + + // The idea here is to match the currency separators and on failure match the number separators to keep the perf of VB's IsNumeric fast. + // The values of decSep are setup to use the correct relevant separator (currency in the if part and decimal in the else part). + decSep = info.CurrencyDecimalSeparator; + groupSep = info.CurrencyGroupSeparator; + parsingCurrency = true; + } + else + { + decSep = info.NumberDecimalSeparator; + groupSep = info.NumberGroupSeparator; + } + + int state = 0; + char* p = str; + char ch = p < strEnd ? *p : '\0'; + char* next; + + while (true) + { + // Eat whitespace unless we've found a sign which isn't followed by a currency symbol. + // "-Kr 1231.47" is legal but "- 1231.47" is not. + if (!IsWhite(ch) || (styles & NumberStyles.AllowLeadingWhite) == 0 || ((state & StateSign) != 0 && ((state & StateCurrency) == 0 && info.NumberNegativePattern != 2))) + { + if ((((styles & NumberStyles.AllowLeadingSign) != 0) && (state & StateSign) == 0) && ((next = MatchChars(p, strEnd, info.PositiveSign)) != null || ((next = MatchNegativeSignChars(p, strEnd, info)) != null && (number.IsNegative = true)))) + { + state |= StateSign; + p = next - 1; + } + else if (ch == '(' && ((styles & NumberStyles.AllowParentheses) != 0) && ((state & StateSign) == 0)) + { + state |= StateSign | StateParens; + number.IsNegative = true; + } + else if (currSymbol != null && (next = MatchChars(p, strEnd, currSymbol)) != null) + { + state |= StateCurrency; + currSymbol = null; + // We already found the currency symbol. There should not be more currency symbols. Set + // currSymbol to NULL so that we won't search it again in the later code path. + p = next - 1; + } + else + { + break; + } + } + ch = ++p < strEnd ? *p : '\0'; + } + + int digCount = 0; + int digEnd = 0; + int maxDigCount = number.Digits.Length - 1; + // int numberOfTrailingZeros = 0; TODO delete this comment + + while (true) + { + if (IsDigit(ch)) + { + state |= StateDigits; + + if (ch != '0' || (state & StateNonZero) != 0) + { + if (digCount < maxDigCount) + { + number.Digits[digCount] = (byte)(ch); + // TODO delete this comment + //if ((ch != '0') || (number.Kind != NumberBufferKind.Integer)) // number.Kind will always not be Integer + //{ + digEnd = digCount + 1; + //} + } + else if (ch != '0') + { + // For decimal and binary floating-point numbers, we only + // need to store digits up to maxDigCount. However, we still + // need to keep track of whether any additional digits past + // maxDigCount were non-zero, as that can impact rounding + // for an input that falls evenly between two representable + // results. + + number.HasNonZeroTail = true; + } + + if ((state & StateDecimal) == 0) + { + number.Scale++; + } + + if (digCount < maxDigCount) + { + // Handle a case like "53.0". We need to ignore trailing zeros in the fractional part for floating point numbers, so we keep a count of the number of trailing zeros and update digCount later + // // TODO delete this comment: I removed this case because we care about trailing zeros for IEEE decimals + /* if (ch == '0') + { + numberOfTrailingZeros++; + } + else + { + numberOfTrailingZeros = 0; + }*/ + } + digCount++; + state |= StateNonZero; + } + else if ((state & StateDecimal) != 0) + { + number.Scale--; + } + } + else if (((styles & NumberStyles.AllowDecimalPoint) != 0) && ((state & StateDecimal) == 0) && ((next = MatchChars(p, strEnd, decSep)) != null || (parsingCurrency && (state & StateCurrency) == 0) && (next = MatchChars(p, strEnd, info.NumberDecimalSeparator)) != null)) + { + state |= StateDecimal; + p = next - 1; + } + else if (((styles & NumberStyles.AllowThousands) != 0) && ((state & StateDigits) != 0) && ((state & StateDecimal) == 0) && ((next = MatchChars(p, strEnd, groupSep)) != null || (parsingCurrency && (state & StateCurrency) == 0) && (next = MatchChars(p, strEnd, info.NumberGroupSeparator)) != null)) + { + p = next - 1; + } + else + { + break; + } + ch = ++p < strEnd ? *p : '\0'; + } + + bool negExp = false; + number.DigitsCount = digEnd; + number.Digits[digEnd] = (byte)('\0'); + if ((state & StateDigits) != 0) + { + if ((ch == 'E' || ch == 'e') && ((styles & NumberStyles.AllowExponent) != 0)) + { + char* temp = p; + ch = ++p < strEnd ? *p : '\0'; + if ((next = MatchChars(p, strEnd, info.PositiveSign)) != null) + { + ch = (p = next) < strEnd ? *p : '\0'; + } + else if ((next = MatchNegativeSignChars(p, strEnd, info)) != null) + { + ch = (p = next) < strEnd ? *p : '\0'; + negExp = true; + } + if (IsDigit(ch)) + { + int exp = 0; + do + { + exp = exp * 10 + (ch - '0'); + ch = ++p < strEnd ? *p : '\0'; + if (exp > 1000) + { + exp = 9999; + while (IsDigit(ch)) + { + ch = ++p < strEnd ? *p : '\0'; + } + } + } while (IsDigit(ch)); + if (negExp) + { + exp = -exp; + } + number.Scale += exp; + } + else + { + p = temp; + ch = p < strEnd ? *p : '\0'; + } + } + + + // TODO delete this comment: I removed this case because we care about trailing zeros for IEEE decimals + /* + if (number.Kind == NumberBufferKind.FloatingPoint && + !number.HasNonZeroTail) + { + // Adjust the number buffer for trailing zeros + + int numberOfFractionalDigits = digEnd - number.Scale; + if (numberOfFractionalDigits > 0) + { + numberOfTrailingZeros = Math.Min(numberOfTrailingZeros, numberOfFractionalDigits); + Debug.Assert(numberOfTrailingZeros >= 0); + number.DigitsCount = digEnd - numberOfTrailingZeros; + number.Digits[number.DigitsCount] = (byte)('\0'); + } + } + */ + + while (true) + { + if (!IsWhite(ch) || (styles & NumberStyles.AllowTrailingWhite) == 0) + { + if ((styles & NumberStyles.AllowTrailingSign) != 0 && ((state & StateSign) == 0) && ((next = MatchChars(p, strEnd, info.PositiveSign)) != null || (((next = MatchNegativeSignChars(p, strEnd, info)) != null) && (number.IsNegative = true)))) + { + state |= StateSign; + p = next - 1; + } + else if (ch == ')' && ((state & StateParens) != 0)) + { + state &= ~StateParens; + } + else if (currSymbol != null && (next = MatchChars(p, strEnd, currSymbol)) != null) + { + currSymbol = null; + p = next - 1; + } + else + { + break; + } + } + ch = ++p < strEnd ? *p : '\0'; + } + if ((state & StateParens) == 0) + { + if ((state & StateNonZero) == 0) + { + // Both of the below should always be false. I believe the first case is handling a specific edge case for System.Decimal that does not apply to the IEEE Decimals. TODO confirm this. +/* if (number.Kind != NumberBufferKind.Decimal) + { + number.Scale = 0; + } + if ((number.Kind == NumberBufferKind.Integer) && (state & StateDecimal) == 0) + { + number.IsNegative = false; + }*/ + } + str = p; + return true; + } + } + str = p; + return false; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static unsafe char* MatchNegativeSignChars(char* p, char* pEnd, NumberFormatInfo info) + { + char* ret = MatchChars(p, pEnd, info.NegativeSign); + if (ret == null && info.AllowHyphenDuringParsing && p < pEnd && *p == '-') + { + ret = p + 1; + } + + return ret; + } + + private static unsafe char* MatchChars(char* p, char* pEnd, string value) + { + Debug.Assert(p != null && pEnd != null && p <= pEnd && value != null); + fixed (char* stringPointer = value) + { + char* str = stringPointer; + if (*str != '\0') + { + // We only hurt the failure case + // This fix is for French or Kazakh cultures. Since a user cannot type 0xA0 or 0x202F as a + // space character we use 0x20 space character instead to mean the same. + while (true) + { + char cp = p < pEnd ? *p : '\0'; + if (cp != *str && !(IsSpaceReplacingChar(*str) && cp == '\u0020')) + { + break; + } + p++; + str++; + if (*str == '\0') + return p; + } + } + } + + return null; + } + + private static bool IsSpaceReplacingChar(char c) => c == '\u00a0' || c == '\u202f'; + + private static bool IsWhite(int ch) => ch == 0x20 || (uint)(ch - 0x09) <= (0x0D - 0x09); + + private static bool IsDigit(int ch) => ((uint)ch - '0') <= 9; + + internal static unsafe Decimal32 NumberToDecimal32(ref IeeeDecimalNumberBuffer number) + { + number.CheckConsistency(); + + if ((number.DigitsCount == 0) || (number.Scale < Decimal32MinExponent)) // TODO double check this + { + // TODO are we sure this is the "right" zero to return in all these cases + return number.IsNegative ? Decimal32.NegativeZero : Decimal32.Zero; + } + else if (number.Scale > Decimal32MaxExponent) // TODO double check this + { + return number.IsNegative ? Decimal32.NegativeInfinity : Decimal32.PositiveInfinity; + } + else + { + // The input value is of the form 0.Mantissa x 10^Exponent, where 'Mantissa' are + // the decimal digits of the mantissa and 'Exponent' is the decimal exponent. + // We want to extract q (the exponent) and c (the significand) such that + // value = c * 10 ^ q + // Which means + // c = first N digits of Mantissa, where N is min(Decimal32.Precision, number.DigitsCount) + // q = Exponent - N + + byte* mantissa = number.GetDigitsPointer(); + + int q = number.Scale; + byte* mantissaPointer = number.GetDigitsPointer(); + uint c = 0; + + int i; + for (i = 0; i < number.DigitsCount; i++) + { + if (i >= Decimal32.Precision) + { + // We have more digits than the precision allows + break; + } + + q--; + c *= 10; + c += (uint)(mantissa[i] - '0'); + } + + if (i < number.DigitsCount) + { + // We have more digits than the precision allows, we might need to round up + // roundUp = (next digit > 5) + // || ((next digit == 5) && (trailing digits || current digit is odd) + bool roundUp = false; + + if (mantissa[i] > '5') + { + roundUp = true; + } + else if (mantissa[i] == '5') + { + + if ((c & 1) == 1) + { + // current digit is odd, round to even regardless of whether or not we have trailing digits + roundUp = true; + + } + else + { + // Current digit is even, but there might be trailing digits that cause us to round up anyway + // We might still have some additional digits, in which case they need + // to be considered as part of hasZeroTail. Some examples of this are: + // * 3.0500000000000000000001e-27 + // * 3.05000000000000000000001e-27 + // In these cases, we will have processed 3 and 0, and ended on 5. The + // buffer, however, will still contain a number of trailing zeros and + // a trailing non-zero number. + + bool hasZeroTail = !number.HasNonZeroTail; + i++; + while ((mantissa[i] != 0) && hasZeroTail) + { + hasZeroTail &= (mantissa[i] == '0'); + i++; + } + + // We should either be at the end of the stream or have a non-zero tail + Debug.Assert((mantissa[i] == 0) || !hasZeroTail); + + if (!hasZeroTail) + { + // If the next digit is 5 with a non-zero tail we must round up + roundUp = true; + } + } + + } + + if (roundUp) + { + if (++c > Decimal32.MaxSignificand) + { + // We have rounded up to Infinity, return early + return number.IsNegative ? Decimal32.NegativeInfinity : Decimal32.PositiveInfinity; + } + } + } + Debug.Assert(q >= Decimal32.MinQExponent && q <= Decimal32.MaxQExponent); + return new Decimal32(number.IsNegative, (sbyte)q, c); + } + } + + internal enum ParsingStatus // No ParsingStatus.Overflow because these types can represent infinity + { + OK, + Failed + } + + private const NumberStyles InvalidNumberStyles = ~(NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite + | NumberStyles.AllowLeadingSign | NumberStyles.AllowTrailingSign + | NumberStyles.AllowParentheses | NumberStyles.AllowDecimalPoint + | NumberStyles.AllowThousands | NumberStyles.AllowExponent + | NumberStyles.AllowCurrencySymbol | NumberStyles.AllowHexSpecifier); + internal static void ValidateParseStyleFloatingPoint(NumberStyles style) + { + // Check for undefined flags or hex number + if ((style & (InvalidNumberStyles | NumberStyles.AllowHexSpecifier)) != 0) + { + ThrowInvalid(style); + + static void ThrowInvalid(NumberStyles value) + { + if ((value & InvalidNumberStyles) != 0) + { + throw new ArgumentException(SR.Argument_InvalidNumberStyles, nameof(style)); + } + + throw new ArgumentException(SR.Arg_HexStyleNotSupported); + } + } + } + + // IeeeDecimalNumber Formatting TODO + } +} diff --git a/src/libraries/System.Runtime.Numerics/src/System/ThrowHelper.cs b/src/libraries/System.Runtime.Numerics/src/System/ThrowHelper.cs index 3a73f6e2c94671..bbc419073b1b57 100644 --- a/src/libraries/System.Runtime.Numerics/src/System/ThrowHelper.cs +++ b/src/libraries/System.Runtime.Numerics/src/System/ThrowHelper.cs @@ -26,5 +26,11 @@ internal static void ThrowValueArgumentOutOfRange_NeedNonNegNumException() { throw new ArgumentOutOfRangeException("value", SR.ArgumentOutOfRange_NeedNonNegNum); } + + [DoesNotReturn] + internal static void ThrowArgumentNullException(string argumentName) + { + throw new ArgumentNullException(argumentName); + } } } diff --git a/src/libraries/System.Runtime.Numerics/tests/Decimal32Tests.cs b/src/libraries/System.Runtime.Numerics/tests/Decimal32Tests.cs new file mode 100644 index 00000000000000..bd813d3a598f3a --- /dev/null +++ b/src/libraries/System.Runtime.Numerics/tests/Decimal32Tests.cs @@ -0,0 +1,277 @@ + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; +using System.Globalization; +using Xunit; + +namespace System.Numerics.Tests +{ + public partial class Decimal32Tests + { + public static IEnumerable Parse_Valid_TestData() + { + NumberStyles defaultStyle = NumberStyles.Float | NumberStyles.AllowThousands; + + NumberFormatInfo emptyFormat = NumberFormatInfo.CurrentInfo; + + var dollarSignCommaSeparatorFormat = new NumberFormatInfo() + { + CurrencySymbol = "$", + CurrencyGroupSeparator = "," + }; + + var decimalSeparatorFormat = new NumberFormatInfo() + { + NumberDecimalSeparator = "." + }; + + NumberFormatInfo invariantFormat = NumberFormatInfo.InvariantInfo; + + // Decimal32(sign, q, c) = -1^sign * 10^q * c + yield return new object[] { "-123", defaultStyle, null, new Decimal32(true, 0, 123) }; + yield return new object[] { "0", defaultStyle, null, Decimal32.Zero }; // TODO what kind of zero do we want to store here? + yield return new object[] { "123", defaultStyle, null, new Decimal32(false, 0, 123) }; + yield return new object[] { " 123 ", defaultStyle, null, new Decimal32(false, 0, 123) }; + yield return new object[] { "567.89", defaultStyle, null, new Decimal32(false, -2, 56789) }; + yield return new object[] { "-567.89", defaultStyle, null, new Decimal32(true, -2, 56789) }; + yield return new object[] { "1E23", defaultStyle, null, new Decimal32(false, 23, 1) }; + + yield return new object[] { emptyFormat.NumberDecimalSeparator + "234", defaultStyle, null, new Decimal32(false, -3, 234) }; + yield return new object[] { "234" + emptyFormat.NumberDecimalSeparator, defaultStyle, null, new Decimal32(false, 0, 234) }; + yield return new object[] { new string('0', 72) + "3" + new string('0', 38) + emptyFormat.NumberDecimalSeparator, defaultStyle, null, new Decimal32(false, 32, 3000000) }; // could be wrong + yield return new object[] { new string('0', 73) + "3" + new string('0', 38) + emptyFormat.NumberDecimalSeparator, defaultStyle, null, new Decimal32(false, 32, 3000000) }; // could be wrong + + // Trailing zeros add sig figs and should be accounted for + yield return new object[] { "1.000", defaultStyle, null, new Decimal32(false, -3, 1000) }; + yield return new object[] { "1.0000000", defaultStyle, null, new Decimal32(false, -6, 1000000) }; + + // 10^7 + 5. Not exactly representable + yield return new object[] { "10000005.0", defaultStyle, invariantFormat, new Decimal32(false, 1, 1000000) }; + yield return new object[] { "10000005.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", defaultStyle, invariantFormat, new Decimal32(false, 1, 1000001) }; + yield return new object[] { "10000005.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", defaultStyle, invariantFormat, new Decimal32(false, 1, 1000001) }; + yield return new object[] { "10000005.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", defaultStyle, invariantFormat, new Decimal32(false, 1, 1000001) }; + yield return new object[] { "5.005", defaultStyle, invariantFormat, new Decimal32(false, -3, 5005) }; + yield return new object[] { "5.050", defaultStyle, invariantFormat, new Decimal32(false, -3, 5050) }; + yield return new object[] { "5.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005", defaultStyle, invariantFormat, new Decimal32(false, -6, 5000000) }; + yield return new object[] { "5.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005", defaultStyle, invariantFormat, new Decimal32(false, -6, 5000000) }; + yield return new object[] { "5.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005", defaultStyle, invariantFormat, new Decimal32(false, -6, 5000000) }; + yield return new object[] { "5.005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", defaultStyle, invariantFormat, new Decimal32(false, -6, 5005000) }; + yield return new object[] { "5.0050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", defaultStyle, invariantFormat, new Decimal32(false, -6, 5005000) }; + yield return new object[] { "5.0050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", defaultStyle, invariantFormat, new Decimal32(false, -6, 5005000) }; + + yield return new object[] { "5005.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", defaultStyle, invariantFormat, new Decimal32(false, -3, 5005000) }; + yield return new object[] { "50050.0", defaultStyle, invariantFormat, new Decimal32(false, -1, 500500) }; + yield return new object[] { "5005", defaultStyle, invariantFormat, new Decimal32(false, 0, 5005) }; + yield return new object[] { "050050", defaultStyle, invariantFormat, new Decimal32(false, 0, 50050) }; + yield return new object[] { "0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", defaultStyle, invariantFormat, Decimal32.Zero }; + yield return new object[] { "0.005", defaultStyle, invariantFormat, new Decimal32(false, -3, 5) }; + yield return new object[] { "0.0500", defaultStyle, invariantFormat, new Decimal32(false, -4, 500) }; + yield return new object[] { "6250000000000000000000000000000000e-12", defaultStyle, invariantFormat, new Decimal32(false, 15, 6250000) }; + yield return new object[] { "6250000e0", defaultStyle, invariantFormat, new Decimal32(false, 0, 6250000) }; + yield return new object[] { "6250100e-5", defaultStyle, invariantFormat, new Decimal32(false, -5, 6250100) }; + yield return new object[] { "625010.00e-4", defaultStyle, invariantFormat, new Decimal32(false, -5, 6250100) }; + yield return new object[] { "62500e-4", defaultStyle, invariantFormat, new Decimal32(false, -4, 62500) }; + yield return new object[] { "62500", defaultStyle, invariantFormat, new Decimal32(false, 0, 62500) }; + + yield return new object[] { "123.1", NumberStyles.AllowDecimalPoint, null, new Decimal32(false, -1, 1231) }; + yield return new object[] { "1,000", NumberStyles.AllowThousands, null, new Decimal32(false, 0, 1000) }; + yield return new object[] { "1,000.0", NumberStyles.AllowThousands | NumberStyles.AllowDecimalPoint, null, new Decimal32(false, -1, 10000) }; + + yield return new object[] { "123", NumberStyles.Any, emptyFormat, new Decimal32(false, 0, 123) }; + yield return new object[] { "123.567", NumberStyles.Any, emptyFormat, new Decimal32(false, -3, 123567) }; + yield return new object[] { "123", NumberStyles.Float, emptyFormat, new Decimal32(false, 0, 123) }; + yield return new object[] { "$1,000", NumberStyles.Currency, dollarSignCommaSeparatorFormat, new Decimal32(false, 0, 1000) }; + yield return new object[] { "$1000", NumberStyles.Currency, dollarSignCommaSeparatorFormat, new Decimal32(false, 0, 1000) }; + yield return new object[] { "123.123", NumberStyles.Float, decimalSeparatorFormat, new Decimal32(false, -3, 123123) }; + yield return new object[] { "(123)", NumberStyles.AllowParentheses, decimalSeparatorFormat, new Decimal32(true, 0, 123) }; // TODO HalfTests and SingleTests have this output -123, but I'm not exactly sure why + + yield return new object[] { "NaN", NumberStyles.Any, invariantFormat, Decimal32.NaN }; + yield return new object[] { "Infinity", NumberStyles.Any, invariantFormat, Decimal32.PositiveInfinity }; + yield return new object[] { "-Infinity", NumberStyles.Any, invariantFormat, Decimal32.NegativeInfinity }; + } + + private static void AssertEqualAndSameQuantum(Decimal32 expected, Decimal32 result) + { + Assert.Equal(expected, result); + Assert.True(Decimal32.SameQuantum(expected, result)); + } + + private static void AssertEqualAndSameQuantumOrBothNan(Decimal32 expected, Decimal32 result) + { + if (!(Decimal32.IsNaN(expected) && Decimal32.IsNaN(result))) + { + AssertEqualAndSameQuantum(expected, result); + } + } + + [Theory] + [MemberData(nameof(Parse_Valid_TestData))] + public static void Parse(string value, NumberStyles style, IFormatProvider provider, Decimal32 expected) + { + bool isDefaultProvider = provider == null || provider == NumberFormatInfo.CurrentInfo; + Decimal32 result; + if ((style & ~(NumberStyles.Float | NumberStyles.AllowThousands)) == 0 && style != NumberStyles.None) + { + // Use Parse(string) or Parse(string, IFormatProvider) + if (isDefaultProvider) + { + Assert.True(Decimal32.TryParse(value, out result)); + AssertEqualAndSameQuantum(expected, result); + + AssertEqualAndSameQuantum(expected, Decimal32.Parse(value)); + } + + Assert.True(Decimal32.TryParse(value, provider: provider, out result)); + AssertEqualAndSameQuantum(expected, result); + + AssertEqualAndSameQuantum(expected, Decimal32.Parse(value, provider: provider)); + } + + // Use Parse(string, NumberStyles, IFormatProvider) + Assert.True(Decimal32.TryParse(value, style, provider, out result)); + + AssertEqualAndSameQuantumOrBothNan(expected, result); + AssertEqualAndSameQuantumOrBothNan(expected, Decimal32.Parse(value, style, provider)); + + if (isDefaultProvider) + { + // Use Parse(string, NumberStyles) or Parse(string, NumberStyles, IFormatProvider) + Assert.True(Decimal32.TryParse(value, style, NumberFormatInfo.CurrentInfo, out result)); + AssertEqualAndSameQuantum(expected, result); + + AssertEqualAndSameQuantum(expected, Decimal32.Parse(value)); + AssertEqualAndSameQuantum(expected, Decimal32.Parse(value, style)); + AssertEqualAndSameQuantum(expected, Decimal32.Parse(value, style, NumberFormatInfo.CurrentInfo)); + } + } + + public static IEnumerable Parse_Invalid_TestData() + { + NumberStyles defaultStyle = NumberStyles.Float; + + var dollarSignDecimalSeparatorFormat = new NumberFormatInfo(); + dollarSignDecimalSeparatorFormat.CurrencySymbol = "$"; + dollarSignDecimalSeparatorFormat.NumberDecimalSeparator = "."; + + yield return new object[] { null, defaultStyle, null, typeof(ArgumentNullException) }; + yield return new object[] { "", defaultStyle, null, typeof(FormatException) }; + yield return new object[] { " ", defaultStyle, null, typeof(FormatException) }; + yield return new object[] { "Garbage", defaultStyle, null, typeof(FormatException) }; + + yield return new object[] { "ab", defaultStyle, null, typeof(FormatException) }; // Hex value + yield return new object[] { "(123)", defaultStyle, null, typeof(FormatException) }; // Parentheses + yield return new object[] { (100.0f).ToString("C0"), defaultStyle, null, typeof(FormatException) }; // Currency + + yield return new object[] { (123.456f).ToString(), NumberStyles.Integer, null, typeof(FormatException) }; // Decimal + yield return new object[] { " " + (123.456f).ToString(), NumberStyles.None, null, typeof(FormatException) }; // Leading space + yield return new object[] { (123.456f).ToString() + " ", NumberStyles.None, null, typeof(FormatException) }; // Leading space + yield return new object[] { "1E23", NumberStyles.None, null, typeof(FormatException) }; // Exponent + + yield return new object[] { "ab", NumberStyles.None, null, typeof(FormatException) }; // Negative hex value + yield return new object[] { " 123 ", NumberStyles.None, null, typeof(FormatException) }; // Trailing and leading whitespace + } + + [Theory] + [MemberData(nameof(Parse_Invalid_TestData))] + public static void Parse_Invalid(string value, NumberStyles style, IFormatProvider provider, Type exceptionType) + { + bool isDefaultProvider = provider == null || provider == NumberFormatInfo.CurrentInfo; + Decimal32 result; + if ((style & ~(NumberStyles.Float | NumberStyles.AllowThousands)) == 0 && style != NumberStyles.None && (style & NumberStyles.AllowLeadingWhite) == (style & NumberStyles.AllowTrailingWhite)) + { + // Use Parse(string) or Parse(string, IFormatProvider) + if (isDefaultProvider) + { + Assert.False(Decimal32.TryParse(value, out result)); + Assert.Equal(default(Decimal32), result); + + Assert.Throws(exceptionType, () => Decimal32.Parse(value)); + } + + Assert.False(Decimal32.TryParse(value, provider: provider, out result)); + Assert.Equal(default(Decimal32), result); + + Assert.Throws(exceptionType, () => Decimal32.Parse(value, provider: provider)); + } + + // Use Parse(string, NumberStyles, IFormatProvider) + Assert.False(Decimal32.TryParse(value, style, provider, out result)); + Assert.Equal(default(Decimal32), result); + + Assert.Throws(exceptionType, () => Decimal32.Parse(value, style, provider)); + + if (isDefaultProvider) + { + // Use Parse(string, NumberStyles) or Parse(string, NumberStyles, IFormatProvider) + Assert.False(Decimal32.TryParse(value, style, NumberFormatInfo.CurrentInfo, out result)); + Assert.Equal(default(Decimal32), result); + + Assert.Throws(exceptionType, () => Decimal32.Parse(value, style)); + Assert.Throws(exceptionType, () => Decimal32.Parse(value, style, NumberFormatInfo.CurrentInfo)); + } + } + + public static IEnumerable Parse_ValidWithOffsetCount_TestData() + { + foreach (object[] inputs in Parse_Valid_TestData()) + { + yield return new object[] { inputs[0], 0, ((string)inputs[0]).Length, inputs[1], inputs[2], inputs[3] }; + } + + const NumberStyles DefaultStyle = NumberStyles.Float | NumberStyles.AllowThousands; + + yield return new object[] { "-123", 1, 3, DefaultStyle, null, new Decimal32(false, 0, 123) }; + yield return new object[] { "-123", 0, 3, DefaultStyle, null, new Decimal32(true, 0, 12) }; + yield return new object[] { "1E23", 0, 3, DefaultStyle, null, new Decimal32(false, 2, 1) }; + yield return new object[] { "123", 0, 2, NumberStyles.Float, new NumberFormatInfo(), new Decimal32(false, 0, 12) }; + yield return new object[] { "$1,000", 1, 3, NumberStyles.Currency, new NumberFormatInfo() { CurrencySymbol = "$", CurrencyGroupSeparator = "," }, new Decimal32(false, 0, 10) }; + yield return new object[] { "(123)", 1, 3, NumberStyles.AllowParentheses, new NumberFormatInfo() { NumberDecimalSeparator = "." }, new Decimal32(false, 0, 123) }; + yield return new object[] { "-Infinity", 1, 8, NumberStyles.Any, NumberFormatInfo.InvariantInfo, Decimal32.PositiveInfinity }; + } + + [Theory] + [MemberData(nameof(Parse_ValidWithOffsetCount_TestData))] + public static void Parse_Span_Valid(string value, int offset, int count, NumberStyles style, IFormatProvider provider, Decimal32 expected) + { + bool isDefaultProvider = provider == null || provider == NumberFormatInfo.CurrentInfo; + Decimal32 result; + if ((style & ~(NumberStyles.Float | NumberStyles.AllowThousands)) == 0 && style != NumberStyles.None) + { + // Use Parse(string) or Parse(string, IFormatProvider) + if (isDefaultProvider) + { + Assert.True(Decimal32.TryParse(value.AsSpan(offset, count), out result)); + AssertEqualAndSameQuantum(expected, result); + + AssertEqualAndSameQuantum(expected, Decimal32.Parse(value.AsSpan(offset, count))); + } + + Assert.True(Decimal32.TryParse(value.AsSpan(offset, count), provider: provider, out result)); + AssertEqualAndSameQuantum(expected, result); + + AssertEqualAndSameQuantum(expected, Decimal32.Parse(value.AsSpan(offset, count), provider: provider)); + } + + AssertEqualAndSameQuantumOrBothNan(expected, Decimal32.Parse(value.AsSpan(offset, count), style, provider)); + + Assert.True(Decimal32.TryParse(value.AsSpan(offset, count), style, provider, out result)); + AssertEqualAndSameQuantumOrBothNan(expected, result); + } + + [Theory] + [MemberData(nameof(Parse_Invalid_TestData))] + public static void Parse_Span_Invalid(string value, NumberStyles style, IFormatProvider provider, Type exceptionType) + { + if (value != null) + { + Assert.Throws(exceptionType, () => Decimal32.Parse(value.AsSpan(), style, provider)); + + Assert.False(Decimal32.TryParse(value.AsSpan(), style, provider, out Decimal32 result)); + Assert.Equal(default(Decimal32), result); + } + } + } +} + diff --git a/src/libraries/System.Runtime.Numerics/tests/System.Runtime.Numerics.Tests.csproj b/src/libraries/System.Runtime.Numerics/tests/System.Runtime.Numerics.Tests.csproj index 541786570e7d20..292af0f36a3518 100644 --- a/src/libraries/System.Runtime.Numerics/tests/System.Runtime.Numerics.Tests.csproj +++ b/src/libraries/System.Runtime.Numerics/tests/System.Runtime.Numerics.Tests.csproj @@ -1,4 +1,4 @@ - + $(NetCoreAppCurrent) true @@ -58,6 +58,7 @@ + diff --git a/src/libraries/System.Runtime/System.Runtime.sln b/src/libraries/System.Runtime/System.Runtime.sln index 728d9bfa0e103d..9c4f81e5043a03 100644 --- a/src/libraries/System.Runtime/System.Runtime.sln +++ b/src/libraries/System.Runtime/System.Runtime.sln @@ -1,4 +1,8 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.32818.431 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Private.CoreLib", "..\..\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj", "{71AB8240-F179-4B21-A8BE-8BE6CD774ED9}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUtilities.Unicode", "..\Common\tests\TestUtilities.Unicode\TestUtilities.Unicode.csproj", "{9DF0247E-5B81-4EF3-82CA-3E70B3A56742}" @@ -67,17 +71,23 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gen", "gen", "{F362E63A-2B1 EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Checked|Any CPU = Checked|Any CPU + Checked|x64 = Checked|x64 + Checked|x86 = Checked|x86 Debug|Any CPU = Debug|Any CPU Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU Release|x64 = Release|x64 Release|x86 = Release|x86 - Checked|Any CPU = Checked|Any CPU - Checked|x64 = Checked|x64 - Checked|x86 = Checked|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Checked|Any CPU.ActiveCfg = Checked|x64 + {71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Checked|Any CPU.Build.0 = Checked|x64 + {71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Checked|x64.ActiveCfg = Checked|x64 + {71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Checked|x64.Build.0 = Checked|x64 + {71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Checked|x86.ActiveCfg = Checked|x86 + {71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Checked|x86.Build.0 = Checked|x86 {71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Debug|Any CPU.ActiveCfg = Debug|x64 {71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Debug|Any CPU.Build.0 = Debug|x64 {71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Debug|x64.ActiveCfg = Debug|x64 @@ -90,12 +100,9 @@ Global {71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Release|x64.Build.0 = Release|x64 {71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Release|x86.ActiveCfg = Release|x86 {71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Release|x86.Build.0 = Release|x86 - {71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Checked|Any CPU.ActiveCfg = Checked|x64 - {71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Checked|Any CPU.Build.0 = Checked|x64 - {71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Checked|x64.ActiveCfg = Checked|x64 - {71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Checked|x64.Build.0 = Checked|x64 - {71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Checked|x86.ActiveCfg = Checked|x86 - {71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Checked|x86.Build.0 = Checked|x86 + {9DF0247E-5B81-4EF3-82CA-3E70B3A56742}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {9DF0247E-5B81-4EF3-82CA-3E70B3A56742}.Checked|x64.ActiveCfg = Debug|Any CPU + {9DF0247E-5B81-4EF3-82CA-3E70B3A56742}.Checked|x86.ActiveCfg = Debug|Any CPU {9DF0247E-5B81-4EF3-82CA-3E70B3A56742}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9DF0247E-5B81-4EF3-82CA-3E70B3A56742}.Debug|Any CPU.Build.0 = Debug|Any CPU {9DF0247E-5B81-4EF3-82CA-3E70B3A56742}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -108,9 +115,9 @@ Global {9DF0247E-5B81-4EF3-82CA-3E70B3A56742}.Release|x64.Build.0 = Release|Any CPU {9DF0247E-5B81-4EF3-82CA-3E70B3A56742}.Release|x86.ActiveCfg = Release|Any CPU {9DF0247E-5B81-4EF3-82CA-3E70B3A56742}.Release|x86.Build.0 = Release|Any CPU - {9DF0247E-5B81-4EF3-82CA-3E70B3A56742}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {9DF0247E-5B81-4EF3-82CA-3E70B3A56742}.Checked|x64.ActiveCfg = Debug|Any CPU - {9DF0247E-5B81-4EF3-82CA-3E70B3A56742}.Checked|x86.ActiveCfg = Debug|Any CPU + {FB17AC52-1633-4845-932B-9218DF895957}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {FB17AC52-1633-4845-932B-9218DF895957}.Checked|x64.ActiveCfg = Debug|Any CPU + {FB17AC52-1633-4845-932B-9218DF895957}.Checked|x86.ActiveCfg = Debug|Any CPU {FB17AC52-1633-4845-932B-9218DF895957}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FB17AC52-1633-4845-932B-9218DF895957}.Debug|Any CPU.Build.0 = Debug|Any CPU {FB17AC52-1633-4845-932B-9218DF895957}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -123,9 +130,9 @@ Global {FB17AC52-1633-4845-932B-9218DF895957}.Release|x64.Build.0 = Release|Any CPU {FB17AC52-1633-4845-932B-9218DF895957}.Release|x86.ActiveCfg = Release|Any CPU {FB17AC52-1633-4845-932B-9218DF895957}.Release|x86.Build.0 = Release|Any CPU - {FB17AC52-1633-4845-932B-9218DF895957}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {FB17AC52-1633-4845-932B-9218DF895957}.Checked|x64.ActiveCfg = Debug|Any CPU - {FB17AC52-1633-4845-932B-9218DF895957}.Checked|x86.ActiveCfg = Debug|Any CPU + {62C2AC8A-7410-4E06-B94E-43BF2DCFBDE9}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {62C2AC8A-7410-4E06-B94E-43BF2DCFBDE9}.Checked|x64.ActiveCfg = Debug|Any CPU + {62C2AC8A-7410-4E06-B94E-43BF2DCFBDE9}.Checked|x86.ActiveCfg = Debug|Any CPU {62C2AC8A-7410-4E06-B94E-43BF2DCFBDE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {62C2AC8A-7410-4E06-B94E-43BF2DCFBDE9}.Debug|Any CPU.Build.0 = Debug|Any CPU {62C2AC8A-7410-4E06-B94E-43BF2DCFBDE9}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -138,9 +145,9 @@ Global {62C2AC8A-7410-4E06-B94E-43BF2DCFBDE9}.Release|x64.Build.0 = Release|Any CPU {62C2AC8A-7410-4E06-B94E-43BF2DCFBDE9}.Release|x86.ActiveCfg = Release|Any CPU {62C2AC8A-7410-4E06-B94E-43BF2DCFBDE9}.Release|x86.Build.0 = Release|Any CPU - {62C2AC8A-7410-4E06-B94E-43BF2DCFBDE9}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {62C2AC8A-7410-4E06-B94E-43BF2DCFBDE9}.Checked|x64.ActiveCfg = Debug|Any CPU - {62C2AC8A-7410-4E06-B94E-43BF2DCFBDE9}.Checked|x86.ActiveCfg = Debug|Any CPU + {B41CB4AB-CDF6-4BB0-B826-D4BAE41411BD}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {B41CB4AB-CDF6-4BB0-B826-D4BAE41411BD}.Checked|x64.ActiveCfg = Debug|Any CPU + {B41CB4AB-CDF6-4BB0-B826-D4BAE41411BD}.Checked|x86.ActiveCfg = Debug|Any CPU {B41CB4AB-CDF6-4BB0-B826-D4BAE41411BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B41CB4AB-CDF6-4BB0-B826-D4BAE41411BD}.Debug|Any CPU.Build.0 = Debug|Any CPU {B41CB4AB-CDF6-4BB0-B826-D4BAE41411BD}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -153,9 +160,9 @@ Global {B41CB4AB-CDF6-4BB0-B826-D4BAE41411BD}.Release|x64.Build.0 = Release|Any CPU {B41CB4AB-CDF6-4BB0-B826-D4BAE41411BD}.Release|x86.ActiveCfg = Release|Any CPU {B41CB4AB-CDF6-4BB0-B826-D4BAE41411BD}.Release|x86.Build.0 = Release|Any CPU - {B41CB4AB-CDF6-4BB0-B826-D4BAE41411BD}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {B41CB4AB-CDF6-4BB0-B826-D4BAE41411BD}.Checked|x64.ActiveCfg = Debug|Any CPU - {B41CB4AB-CDF6-4BB0-B826-D4BAE41411BD}.Checked|x86.ActiveCfg = Debug|Any CPU + {9C41B325-1225-43CA-9436-549AFF6D90A1}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {9C41B325-1225-43CA-9436-549AFF6D90A1}.Checked|x64.ActiveCfg = Debug|Any CPU + {9C41B325-1225-43CA-9436-549AFF6D90A1}.Checked|x86.ActiveCfg = Debug|Any CPU {9C41B325-1225-43CA-9436-549AFF6D90A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9C41B325-1225-43CA-9436-549AFF6D90A1}.Debug|Any CPU.Build.0 = Debug|Any CPU {9C41B325-1225-43CA-9436-549AFF6D90A1}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -168,9 +175,9 @@ Global {9C41B325-1225-43CA-9436-549AFF6D90A1}.Release|x64.Build.0 = Release|Any CPU {9C41B325-1225-43CA-9436-549AFF6D90A1}.Release|x86.ActiveCfg = Release|Any CPU {9C41B325-1225-43CA-9436-549AFF6D90A1}.Release|x86.Build.0 = Release|Any CPU - {9C41B325-1225-43CA-9436-549AFF6D90A1}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {9C41B325-1225-43CA-9436-549AFF6D90A1}.Checked|x64.ActiveCfg = Debug|Any CPU - {9C41B325-1225-43CA-9436-549AFF6D90A1}.Checked|x86.ActiveCfg = Debug|Any CPU + {F27DC16B-64F4-4BD7-AF9C-1C76F7ACC88B}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {F27DC16B-64F4-4BD7-AF9C-1C76F7ACC88B}.Checked|x64.ActiveCfg = Debug|Any CPU + {F27DC16B-64F4-4BD7-AF9C-1C76F7ACC88B}.Checked|x86.ActiveCfg = Debug|Any CPU {F27DC16B-64F4-4BD7-AF9C-1C76F7ACC88B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F27DC16B-64F4-4BD7-AF9C-1C76F7ACC88B}.Debug|Any CPU.Build.0 = Debug|Any CPU {F27DC16B-64F4-4BD7-AF9C-1C76F7ACC88B}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -183,9 +190,9 @@ Global {F27DC16B-64F4-4BD7-AF9C-1C76F7ACC88B}.Release|x64.Build.0 = Release|Any CPU {F27DC16B-64F4-4BD7-AF9C-1C76F7ACC88B}.Release|x86.ActiveCfg = Release|Any CPU {F27DC16B-64F4-4BD7-AF9C-1C76F7ACC88B}.Release|x86.Build.0 = Release|Any CPU - {F27DC16B-64F4-4BD7-AF9C-1C76F7ACC88B}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {F27DC16B-64F4-4BD7-AF9C-1C76F7ACC88B}.Checked|x64.ActiveCfg = Debug|Any CPU - {F27DC16B-64F4-4BD7-AF9C-1C76F7ACC88B}.Checked|x86.ActiveCfg = Debug|Any CPU + {CF79B5AE-38CB-4B80-BF92-CF634C0B7EC3}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {CF79B5AE-38CB-4B80-BF92-CF634C0B7EC3}.Checked|x64.ActiveCfg = Debug|Any CPU + {CF79B5AE-38CB-4B80-BF92-CF634C0B7EC3}.Checked|x86.ActiveCfg = Debug|Any CPU {CF79B5AE-38CB-4B80-BF92-CF634C0B7EC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CF79B5AE-38CB-4B80-BF92-CF634C0B7EC3}.Debug|Any CPU.Build.0 = Debug|Any CPU {CF79B5AE-38CB-4B80-BF92-CF634C0B7EC3}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -198,9 +205,9 @@ Global {CF79B5AE-38CB-4B80-BF92-CF634C0B7EC3}.Release|x64.Build.0 = Release|Any CPU {CF79B5AE-38CB-4B80-BF92-CF634C0B7EC3}.Release|x86.ActiveCfg = Release|Any CPU {CF79B5AE-38CB-4B80-BF92-CF634C0B7EC3}.Release|x86.Build.0 = Release|Any CPU - {CF79B5AE-38CB-4B80-BF92-CF634C0B7EC3}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {CF79B5AE-38CB-4B80-BF92-CF634C0B7EC3}.Checked|x64.ActiveCfg = Debug|Any CPU - {CF79B5AE-38CB-4B80-BF92-CF634C0B7EC3}.Checked|x86.ActiveCfg = Debug|Any CPU + {E64D31D0-8F38-4FDF-B60D-F955D2475566}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {E64D31D0-8F38-4FDF-B60D-F955D2475566}.Checked|x64.ActiveCfg = Debug|Any CPU + {E64D31D0-8F38-4FDF-B60D-F955D2475566}.Checked|x86.ActiveCfg = Debug|Any CPU {E64D31D0-8F38-4FDF-B60D-F955D2475566}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E64D31D0-8F38-4FDF-B60D-F955D2475566}.Debug|Any CPU.Build.0 = Debug|Any CPU {E64D31D0-8F38-4FDF-B60D-F955D2475566}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -213,9 +220,9 @@ Global {E64D31D0-8F38-4FDF-B60D-F955D2475566}.Release|x64.Build.0 = Release|Any CPU {E64D31D0-8F38-4FDF-B60D-F955D2475566}.Release|x86.ActiveCfg = Release|Any CPU {E64D31D0-8F38-4FDF-B60D-F955D2475566}.Release|x86.Build.0 = Release|Any CPU - {E64D31D0-8F38-4FDF-B60D-F955D2475566}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {E64D31D0-8F38-4FDF-B60D-F955D2475566}.Checked|x64.ActiveCfg = Debug|Any CPU - {E64D31D0-8F38-4FDF-B60D-F955D2475566}.Checked|x86.ActiveCfg = Debug|Any CPU + {E7A05515-DABE-4C09-83CB-CE84EFDCD4CC}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {E7A05515-DABE-4C09-83CB-CE84EFDCD4CC}.Checked|x64.ActiveCfg = Debug|Any CPU + {E7A05515-DABE-4C09-83CB-CE84EFDCD4CC}.Checked|x86.ActiveCfg = Debug|Any CPU {E7A05515-DABE-4C09-83CB-CE84EFDCD4CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E7A05515-DABE-4C09-83CB-CE84EFDCD4CC}.Debug|Any CPU.Build.0 = Debug|Any CPU {E7A05515-DABE-4C09-83CB-CE84EFDCD4CC}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -228,9 +235,9 @@ Global {E7A05515-DABE-4C09-83CB-CE84EFDCD4CC}.Release|x64.Build.0 = Release|Any CPU {E7A05515-DABE-4C09-83CB-CE84EFDCD4CC}.Release|x86.ActiveCfg = Release|Any CPU {E7A05515-DABE-4C09-83CB-CE84EFDCD4CC}.Release|x86.Build.0 = Release|Any CPU - {E7A05515-DABE-4C09-83CB-CE84EFDCD4CC}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {E7A05515-DABE-4C09-83CB-CE84EFDCD4CC}.Checked|x64.ActiveCfg = Debug|Any CPU - {E7A05515-DABE-4C09-83CB-CE84EFDCD4CC}.Checked|x86.ActiveCfg = Debug|Any CPU + {4FA4A9A6-1D38-414B-96F0-3CFB63C687C9}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {4FA4A9A6-1D38-414B-96F0-3CFB63C687C9}.Checked|x64.ActiveCfg = Debug|Any CPU + {4FA4A9A6-1D38-414B-96F0-3CFB63C687C9}.Checked|x86.ActiveCfg = Debug|Any CPU {4FA4A9A6-1D38-414B-96F0-3CFB63C687C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4FA4A9A6-1D38-414B-96F0-3CFB63C687C9}.Debug|Any CPU.Build.0 = Debug|Any CPU {4FA4A9A6-1D38-414B-96F0-3CFB63C687C9}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -243,9 +250,9 @@ Global {4FA4A9A6-1D38-414B-96F0-3CFB63C687C9}.Release|x64.Build.0 = Release|Any CPU {4FA4A9A6-1D38-414B-96F0-3CFB63C687C9}.Release|x86.ActiveCfg = Release|Any CPU {4FA4A9A6-1D38-414B-96F0-3CFB63C687C9}.Release|x86.Build.0 = Release|Any CPU - {4FA4A9A6-1D38-414B-96F0-3CFB63C687C9}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {4FA4A9A6-1D38-414B-96F0-3CFB63C687C9}.Checked|x64.ActiveCfg = Debug|Any CPU - {4FA4A9A6-1D38-414B-96F0-3CFB63C687C9}.Checked|x86.ActiveCfg = Debug|Any CPU + {A7B7DE04-7261-4D4C-AA78-9F2D9B5A1C37}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {A7B7DE04-7261-4D4C-AA78-9F2D9B5A1C37}.Checked|x64.ActiveCfg = Debug|Any CPU + {A7B7DE04-7261-4D4C-AA78-9F2D9B5A1C37}.Checked|x86.ActiveCfg = Debug|Any CPU {A7B7DE04-7261-4D4C-AA78-9F2D9B5A1C37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A7B7DE04-7261-4D4C-AA78-9F2D9B5A1C37}.Debug|Any CPU.Build.0 = Debug|Any CPU {A7B7DE04-7261-4D4C-AA78-9F2D9B5A1C37}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -258,9 +265,9 @@ Global {A7B7DE04-7261-4D4C-AA78-9F2D9B5A1C37}.Release|x64.Build.0 = Release|Any CPU {A7B7DE04-7261-4D4C-AA78-9F2D9B5A1C37}.Release|x86.ActiveCfg = Release|Any CPU {A7B7DE04-7261-4D4C-AA78-9F2D9B5A1C37}.Release|x86.Build.0 = Release|Any CPU - {A7B7DE04-7261-4D4C-AA78-9F2D9B5A1C37}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {A7B7DE04-7261-4D4C-AA78-9F2D9B5A1C37}.Checked|x64.ActiveCfg = Debug|Any CPU - {A7B7DE04-7261-4D4C-AA78-9F2D9B5A1C37}.Checked|x86.ActiveCfg = Debug|Any CPU + {F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Checked|x64.ActiveCfg = Debug|Any CPU + {F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Checked|x86.ActiveCfg = Debug|Any CPU {F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Debug|Any CPU.Build.0 = Debug|Any CPU {F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -273,9 +280,9 @@ Global {F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Release|x64.Build.0 = Release|Any CPU {F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Release|x86.ActiveCfg = Release|Any CPU {F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Release|x86.Build.0 = Release|Any CPU - {F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Checked|x64.ActiveCfg = Debug|Any CPU - {F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Checked|x86.ActiveCfg = Debug|Any CPU + {A83A8520-F5E2-49B4-83BC-0F82A412951D}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {A83A8520-F5E2-49B4-83BC-0F82A412951D}.Checked|x64.ActiveCfg = Debug|Any CPU + {A83A8520-F5E2-49B4-83BC-0F82A412951D}.Checked|x86.ActiveCfg = Debug|Any CPU {A83A8520-F5E2-49B4-83BC-0F82A412951D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A83A8520-F5E2-49B4-83BC-0F82A412951D}.Debug|Any CPU.Build.0 = Debug|Any CPU {A83A8520-F5E2-49B4-83BC-0F82A412951D}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -288,9 +295,9 @@ Global {A83A8520-F5E2-49B4-83BC-0F82A412951D}.Release|x64.Build.0 = Release|Any CPU {A83A8520-F5E2-49B4-83BC-0F82A412951D}.Release|x86.ActiveCfg = Release|Any CPU {A83A8520-F5E2-49B4-83BC-0F82A412951D}.Release|x86.Build.0 = Release|Any CPU - {A83A8520-F5E2-49B4-83BC-0F82A412951D}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {A83A8520-F5E2-49B4-83BC-0F82A412951D}.Checked|x64.ActiveCfg = Debug|Any CPU - {A83A8520-F5E2-49B4-83BC-0F82A412951D}.Checked|x86.ActiveCfg = Debug|Any CPU + {3B79DD71-8C2F-41BC-A1A7-86A490D6C726}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {3B79DD71-8C2F-41BC-A1A7-86A490D6C726}.Checked|x64.ActiveCfg = Debug|Any CPU + {3B79DD71-8C2F-41BC-A1A7-86A490D6C726}.Checked|x86.ActiveCfg = Debug|Any CPU {3B79DD71-8C2F-41BC-A1A7-86A490D6C726}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3B79DD71-8C2F-41BC-A1A7-86A490D6C726}.Debug|Any CPU.Build.0 = Debug|Any CPU {3B79DD71-8C2F-41BC-A1A7-86A490D6C726}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -303,9 +310,9 @@ Global {3B79DD71-8C2F-41BC-A1A7-86A490D6C726}.Release|x64.Build.0 = Release|Any CPU {3B79DD71-8C2F-41BC-A1A7-86A490D6C726}.Release|x86.ActiveCfg = Release|Any CPU {3B79DD71-8C2F-41BC-A1A7-86A490D6C726}.Release|x86.Build.0 = Release|Any CPU - {3B79DD71-8C2F-41BC-A1A7-86A490D6C726}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {3B79DD71-8C2F-41BC-A1A7-86A490D6C726}.Checked|x64.ActiveCfg = Debug|Any CPU - {3B79DD71-8C2F-41BC-A1A7-86A490D6C726}.Checked|x86.ActiveCfg = Debug|Any CPU + {4EE36055-AD7C-4779-B3F6-08687960DCC3}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {4EE36055-AD7C-4779-B3F6-08687960DCC3}.Checked|x64.ActiveCfg = Debug|Any CPU + {4EE36055-AD7C-4779-B3F6-08687960DCC3}.Checked|x86.ActiveCfg = Debug|Any CPU {4EE36055-AD7C-4779-B3F6-08687960DCC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4EE36055-AD7C-4779-B3F6-08687960DCC3}.Debug|Any CPU.Build.0 = Debug|Any CPU {4EE36055-AD7C-4779-B3F6-08687960DCC3}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -318,9 +325,9 @@ Global {4EE36055-AD7C-4779-B3F6-08687960DCC3}.Release|x64.Build.0 = Release|Any CPU {4EE36055-AD7C-4779-B3F6-08687960DCC3}.Release|x86.ActiveCfg = Release|Any CPU {4EE36055-AD7C-4779-B3F6-08687960DCC3}.Release|x86.Build.0 = Release|Any CPU - {4EE36055-AD7C-4779-B3F6-08687960DCC3}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {4EE36055-AD7C-4779-B3F6-08687960DCC3}.Checked|x64.ActiveCfg = Debug|Any CPU - {4EE36055-AD7C-4779-B3F6-08687960DCC3}.Checked|x86.ActiveCfg = Debug|Any CPU + {C3F25EEF-04B4-407A-960B-0C1CE9C04430}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {C3F25EEF-04B4-407A-960B-0C1CE9C04430}.Checked|x64.ActiveCfg = Debug|Any CPU + {C3F25EEF-04B4-407A-960B-0C1CE9C04430}.Checked|x86.ActiveCfg = Debug|Any CPU {C3F25EEF-04B4-407A-960B-0C1CE9C04430}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C3F25EEF-04B4-407A-960B-0C1CE9C04430}.Debug|Any CPU.Build.0 = Debug|Any CPU {C3F25EEF-04B4-407A-960B-0C1CE9C04430}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -333,9 +340,9 @@ Global {C3F25EEF-04B4-407A-960B-0C1CE9C04430}.Release|x64.Build.0 = Release|Any CPU {C3F25EEF-04B4-407A-960B-0C1CE9C04430}.Release|x86.ActiveCfg = Release|Any CPU {C3F25EEF-04B4-407A-960B-0C1CE9C04430}.Release|x86.Build.0 = Release|Any CPU - {C3F25EEF-04B4-407A-960B-0C1CE9C04430}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {C3F25EEF-04B4-407A-960B-0C1CE9C04430}.Checked|x64.ActiveCfg = Debug|Any CPU - {C3F25EEF-04B4-407A-960B-0C1CE9C04430}.Checked|x86.ActiveCfg = Debug|Any CPU + {47E26787-7C27-4572-AD8B-868DE44E2C48}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {47E26787-7C27-4572-AD8B-868DE44E2C48}.Checked|x64.ActiveCfg = Debug|Any CPU + {47E26787-7C27-4572-AD8B-868DE44E2C48}.Checked|x86.ActiveCfg = Debug|Any CPU {47E26787-7C27-4572-AD8B-868DE44E2C48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {47E26787-7C27-4572-AD8B-868DE44E2C48}.Debug|Any CPU.Build.0 = Debug|Any CPU {47E26787-7C27-4572-AD8B-868DE44E2C48}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -348,9 +355,9 @@ Global {47E26787-7C27-4572-AD8B-868DE44E2C48}.Release|x64.Build.0 = Release|Any CPU {47E26787-7C27-4572-AD8B-868DE44E2C48}.Release|x86.ActiveCfg = Release|Any CPU {47E26787-7C27-4572-AD8B-868DE44E2C48}.Release|x86.Build.0 = Release|Any CPU - {47E26787-7C27-4572-AD8B-868DE44E2C48}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {47E26787-7C27-4572-AD8B-868DE44E2C48}.Checked|x64.ActiveCfg = Debug|Any CPU - {47E26787-7C27-4572-AD8B-868DE44E2C48}.Checked|x86.ActiveCfg = Debug|Any CPU + {C230AC88-A377-4BEB-824F-AB174C14DC86}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {C230AC88-A377-4BEB-824F-AB174C14DC86}.Checked|x64.ActiveCfg = Debug|Any CPU + {C230AC88-A377-4BEB-824F-AB174C14DC86}.Checked|x86.ActiveCfg = Debug|Any CPU {C230AC88-A377-4BEB-824F-AB174C14DC86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C230AC88-A377-4BEB-824F-AB174C14DC86}.Debug|Any CPU.Build.0 = Debug|Any CPU {C230AC88-A377-4BEB-824F-AB174C14DC86}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -363,9 +370,9 @@ Global {C230AC88-A377-4BEB-824F-AB174C14DC86}.Release|x64.Build.0 = Release|Any CPU {C230AC88-A377-4BEB-824F-AB174C14DC86}.Release|x86.ActiveCfg = Release|Any CPU {C230AC88-A377-4BEB-824F-AB174C14DC86}.Release|x86.Build.0 = Release|Any CPU - {C230AC88-A377-4BEB-824F-AB174C14DC86}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {C230AC88-A377-4BEB-824F-AB174C14DC86}.Checked|x64.ActiveCfg = Debug|Any CPU - {C230AC88-A377-4BEB-824F-AB174C14DC86}.Checked|x86.ActiveCfg = Debug|Any CPU + {1BCCD2F5-A561-4641-8A0B-51F3EDCA35DC}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {1BCCD2F5-A561-4641-8A0B-51F3EDCA35DC}.Checked|x64.ActiveCfg = Debug|Any CPU + {1BCCD2F5-A561-4641-8A0B-51F3EDCA35DC}.Checked|x86.ActiveCfg = Debug|Any CPU {1BCCD2F5-A561-4641-8A0B-51F3EDCA35DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1BCCD2F5-A561-4641-8A0B-51F3EDCA35DC}.Debug|Any CPU.Build.0 = Debug|Any CPU {1BCCD2F5-A561-4641-8A0B-51F3EDCA35DC}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -378,9 +385,9 @@ Global {1BCCD2F5-A561-4641-8A0B-51F3EDCA35DC}.Release|x64.Build.0 = Release|Any CPU {1BCCD2F5-A561-4641-8A0B-51F3EDCA35DC}.Release|x86.ActiveCfg = Release|Any CPU {1BCCD2F5-A561-4641-8A0B-51F3EDCA35DC}.Release|x86.Build.0 = Release|Any CPU - {1BCCD2F5-A561-4641-8A0B-51F3EDCA35DC}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {1BCCD2F5-A561-4641-8A0B-51F3EDCA35DC}.Checked|x64.ActiveCfg = Debug|Any CPU - {1BCCD2F5-A561-4641-8A0B-51F3EDCA35DC}.Checked|x86.ActiveCfg = Debug|Any CPU + {0F83B07B-2E3F-4708-BE6D-7A8DA8168803}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {0F83B07B-2E3F-4708-BE6D-7A8DA8168803}.Checked|x64.ActiveCfg = Debug|Any CPU + {0F83B07B-2E3F-4708-BE6D-7A8DA8168803}.Checked|x86.ActiveCfg = Debug|Any CPU {0F83B07B-2E3F-4708-BE6D-7A8DA8168803}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0F83B07B-2E3F-4708-BE6D-7A8DA8168803}.Debug|Any CPU.Build.0 = Debug|Any CPU {0F83B07B-2E3F-4708-BE6D-7A8DA8168803}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -393,9 +400,9 @@ Global {0F83B07B-2E3F-4708-BE6D-7A8DA8168803}.Release|x64.Build.0 = Release|Any CPU {0F83B07B-2E3F-4708-BE6D-7A8DA8168803}.Release|x86.ActiveCfg = Release|Any CPU {0F83B07B-2E3F-4708-BE6D-7A8DA8168803}.Release|x86.Build.0 = Release|Any CPU - {0F83B07B-2E3F-4708-BE6D-7A8DA8168803}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {0F83B07B-2E3F-4708-BE6D-7A8DA8168803}.Checked|x64.ActiveCfg = Debug|Any CPU - {0F83B07B-2E3F-4708-BE6D-7A8DA8168803}.Checked|x86.ActiveCfg = Debug|Any CPU + {833C1D45-9BBB-4A92-93B7-4EFFD9E945AD}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {833C1D45-9BBB-4A92-93B7-4EFFD9E945AD}.Checked|x64.ActiveCfg = Debug|Any CPU + {833C1D45-9BBB-4A92-93B7-4EFFD9E945AD}.Checked|x86.ActiveCfg = Debug|Any CPU {833C1D45-9BBB-4A92-93B7-4EFFD9E945AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {833C1D45-9BBB-4A92-93B7-4EFFD9E945AD}.Debug|Any CPU.Build.0 = Debug|Any CPU {833C1D45-9BBB-4A92-93B7-4EFFD9E945AD}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -408,9 +415,9 @@ Global {833C1D45-9BBB-4A92-93B7-4EFFD9E945AD}.Release|x64.Build.0 = Release|Any CPU {833C1D45-9BBB-4A92-93B7-4EFFD9E945AD}.Release|x86.ActiveCfg = Release|Any CPU {833C1D45-9BBB-4A92-93B7-4EFFD9E945AD}.Release|x86.Build.0 = Release|Any CPU - {833C1D45-9BBB-4A92-93B7-4EFFD9E945AD}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {833C1D45-9BBB-4A92-93B7-4EFFD9E945AD}.Checked|x64.ActiveCfg = Debug|Any CPU - {833C1D45-9BBB-4A92-93B7-4EFFD9E945AD}.Checked|x86.ActiveCfg = Debug|Any CPU + {1B4552A4-91FD-4C6F-9EB4-3454C4BE428F}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {1B4552A4-91FD-4C6F-9EB4-3454C4BE428F}.Checked|x64.ActiveCfg = Debug|Any CPU + {1B4552A4-91FD-4C6F-9EB4-3454C4BE428F}.Checked|x86.ActiveCfg = Debug|Any CPU {1B4552A4-91FD-4C6F-9EB4-3454C4BE428F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1B4552A4-91FD-4C6F-9EB4-3454C4BE428F}.Debug|Any CPU.Build.0 = Debug|Any CPU {1B4552A4-91FD-4C6F-9EB4-3454C4BE428F}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -423,9 +430,9 @@ Global {1B4552A4-91FD-4C6F-9EB4-3454C4BE428F}.Release|x64.Build.0 = Release|Any CPU {1B4552A4-91FD-4C6F-9EB4-3454C4BE428F}.Release|x86.ActiveCfg = Release|Any CPU {1B4552A4-91FD-4C6F-9EB4-3454C4BE428F}.Release|x86.Build.0 = Release|Any CPU - {1B4552A4-91FD-4C6F-9EB4-3454C4BE428F}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {1B4552A4-91FD-4C6F-9EB4-3454C4BE428F}.Checked|x64.ActiveCfg = Debug|Any CPU - {1B4552A4-91FD-4C6F-9EB4-3454C4BE428F}.Checked|x86.ActiveCfg = Debug|Any CPU + {F6A8185B-07C6-401D-9B40-3C560239E05F}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {F6A8185B-07C6-401D-9B40-3C560239E05F}.Checked|x64.ActiveCfg = Debug|Any CPU + {F6A8185B-07C6-401D-9B40-3C560239E05F}.Checked|x86.ActiveCfg = Debug|Any CPU {F6A8185B-07C6-401D-9B40-3C560239E05F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F6A8185B-07C6-401D-9B40-3C560239E05F}.Debug|Any CPU.Build.0 = Debug|Any CPU {F6A8185B-07C6-401D-9B40-3C560239E05F}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -438,9 +445,9 @@ Global {F6A8185B-07C6-401D-9B40-3C560239E05F}.Release|x64.Build.0 = Release|Any CPU {F6A8185B-07C6-401D-9B40-3C560239E05F}.Release|x86.ActiveCfg = Release|Any CPU {F6A8185B-07C6-401D-9B40-3C560239E05F}.Release|x86.Build.0 = Release|Any CPU - {F6A8185B-07C6-401D-9B40-3C560239E05F}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {F6A8185B-07C6-401D-9B40-3C560239E05F}.Checked|x64.ActiveCfg = Debug|Any CPU - {F6A8185B-07C6-401D-9B40-3C560239E05F}.Checked|x86.ActiveCfg = Debug|Any CPU + {EC777939-BE30-4ED9-9FE1-451DD7472467}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {EC777939-BE30-4ED9-9FE1-451DD7472467}.Checked|x64.ActiveCfg = Debug|Any CPU + {EC777939-BE30-4ED9-9FE1-451DD7472467}.Checked|x86.ActiveCfg = Debug|Any CPU {EC777939-BE30-4ED9-9FE1-451DD7472467}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EC777939-BE30-4ED9-9FE1-451DD7472467}.Debug|Any CPU.Build.0 = Debug|Any CPU {EC777939-BE30-4ED9-9FE1-451DD7472467}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -453,9 +460,9 @@ Global {EC777939-BE30-4ED9-9FE1-451DD7472467}.Release|x64.Build.0 = Release|Any CPU {EC777939-BE30-4ED9-9FE1-451DD7472467}.Release|x86.ActiveCfg = Release|Any CPU {EC777939-BE30-4ED9-9FE1-451DD7472467}.Release|x86.Build.0 = Release|Any CPU - {EC777939-BE30-4ED9-9FE1-451DD7472467}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {EC777939-BE30-4ED9-9FE1-451DD7472467}.Checked|x64.ActiveCfg = Debug|Any CPU - {EC777939-BE30-4ED9-9FE1-451DD7472467}.Checked|x86.ActiveCfg = Debug|Any CPU + {25E8AB9D-2D10-44F5-9F83-5A5134526771}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {25E8AB9D-2D10-44F5-9F83-5A5134526771}.Checked|x64.ActiveCfg = Debug|Any CPU + {25E8AB9D-2D10-44F5-9F83-5A5134526771}.Checked|x86.ActiveCfg = Debug|Any CPU {25E8AB9D-2D10-44F5-9F83-5A5134526771}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {25E8AB9D-2D10-44F5-9F83-5A5134526771}.Debug|Any CPU.Build.0 = Debug|Any CPU {25E8AB9D-2D10-44F5-9F83-5A5134526771}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -468,9 +475,9 @@ Global {25E8AB9D-2D10-44F5-9F83-5A5134526771}.Release|x64.Build.0 = Release|Any CPU {25E8AB9D-2D10-44F5-9F83-5A5134526771}.Release|x86.ActiveCfg = Release|Any CPU {25E8AB9D-2D10-44F5-9F83-5A5134526771}.Release|x86.Build.0 = Release|Any CPU - {25E8AB9D-2D10-44F5-9F83-5A5134526771}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {25E8AB9D-2D10-44F5-9F83-5A5134526771}.Checked|x64.ActiveCfg = Debug|Any CPU - {25E8AB9D-2D10-44F5-9F83-5A5134526771}.Checked|x86.ActiveCfg = Debug|Any CPU + {9CF6C6E6-0E9F-4A95-84B5-6083EAB6FA13}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {9CF6C6E6-0E9F-4A95-84B5-6083EAB6FA13}.Checked|x64.ActiveCfg = Debug|Any CPU + {9CF6C6E6-0E9F-4A95-84B5-6083EAB6FA13}.Checked|x86.ActiveCfg = Debug|Any CPU {9CF6C6E6-0E9F-4A95-84B5-6083EAB6FA13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9CF6C6E6-0E9F-4A95-84B5-6083EAB6FA13}.Debug|Any CPU.Build.0 = Debug|Any CPU {9CF6C6E6-0E9F-4A95-84B5-6083EAB6FA13}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -483,9 +490,9 @@ Global {9CF6C6E6-0E9F-4A95-84B5-6083EAB6FA13}.Release|x64.Build.0 = Release|Any CPU {9CF6C6E6-0E9F-4A95-84B5-6083EAB6FA13}.Release|x86.ActiveCfg = Release|Any CPU {9CF6C6E6-0E9F-4A95-84B5-6083EAB6FA13}.Release|x86.Build.0 = Release|Any CPU - {9CF6C6E6-0E9F-4A95-84B5-6083EAB6FA13}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {9CF6C6E6-0E9F-4A95-84B5-6083EAB6FA13}.Checked|x64.ActiveCfg = Debug|Any CPU - {9CF6C6E6-0E9F-4A95-84B5-6083EAB6FA13}.Checked|x86.ActiveCfg = Debug|Any CPU + {82728202-1098-4E16-B598-5762EAF67D08}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {82728202-1098-4E16-B598-5762EAF67D08}.Checked|x64.ActiveCfg = Debug|Any CPU + {82728202-1098-4E16-B598-5762EAF67D08}.Checked|x86.ActiveCfg = Debug|Any CPU {82728202-1098-4E16-B598-5762EAF67D08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {82728202-1098-4E16-B598-5762EAF67D08}.Debug|Any CPU.Build.0 = Debug|Any CPU {82728202-1098-4E16-B598-5762EAF67D08}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -498,9 +505,9 @@ Global {82728202-1098-4E16-B598-5762EAF67D08}.Release|x64.Build.0 = Release|Any CPU {82728202-1098-4E16-B598-5762EAF67D08}.Release|x86.ActiveCfg = Release|Any CPU {82728202-1098-4E16-B598-5762EAF67D08}.Release|x86.Build.0 = Release|Any CPU - {82728202-1098-4E16-B598-5762EAF67D08}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {82728202-1098-4E16-B598-5762EAF67D08}.Checked|x64.ActiveCfg = Debug|Any CPU - {82728202-1098-4E16-B598-5762EAF67D08}.Checked|x86.ActiveCfg = Debug|Any CPU + {069C2B51-069A-4FBB-BFE9-42D573F1CEEA}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {069C2B51-069A-4FBB-BFE9-42D573F1CEEA}.Checked|x64.ActiveCfg = Debug|Any CPU + {069C2B51-069A-4FBB-BFE9-42D573F1CEEA}.Checked|x86.ActiveCfg = Debug|Any CPU {069C2B51-069A-4FBB-BFE9-42D573F1CEEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {069C2B51-069A-4FBB-BFE9-42D573F1CEEA}.Debug|Any CPU.Build.0 = Debug|Any CPU {069C2B51-069A-4FBB-BFE9-42D573F1CEEA}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -513,24 +520,25 @@ Global {069C2B51-069A-4FBB-BFE9-42D573F1CEEA}.Release|x64.Build.0 = Release|Any CPU {069C2B51-069A-4FBB-BFE9-42D573F1CEEA}.Release|x86.ActiveCfg = Release|Any CPU {069C2B51-069A-4FBB-BFE9-42D573F1CEEA}.Release|x86.Build.0 = Release|Any CPU - {069C2B51-069A-4FBB-BFE9-42D573F1CEEA}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {069C2B51-069A-4FBB-BFE9-42D573F1CEEA}.Checked|x64.ActiveCfg = Debug|Any CPU - {069C2B51-069A-4FBB-BFE9-42D573F1CEEA}.Checked|x86.ActiveCfg = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {71AB8240-F179-4B21-A8BE-8BE6CD774ED9} = {28140562-A65A-48E9-ABAB-53BA939084F0} + {9DF0247E-5B81-4EF3-82CA-3E70B3A56742} = {FD72C125-C10D-457B-8AFC-6B4E5237AF6A} + {FB17AC52-1633-4845-932B-9218DF895957} = {FD72C125-C10D-457B-8AFC-6B4E5237AF6A} + {62C2AC8A-7410-4E06-B94E-43BF2DCFBDE9} = {5B2B5E7E-A2FB-4095-9E79-404BF53E0133} {B41CB4AB-CDF6-4BB0-B826-D4BAE41411BD} = {28140562-A65A-48E9-ABAB-53BA939084F0} + {9C41B325-1225-43CA-9436-549AFF6D90A1} = {5B2B5E7E-A2FB-4095-9E79-404BF53E0133} {F27DC16B-64F4-4BD7-AF9C-1C76F7ACC88B} = {28140562-A65A-48E9-ABAB-53BA939084F0} + {CF79B5AE-38CB-4B80-BF92-CF634C0B7EC3} = {F362E63A-2B1A-445B-B198-3071D7DDE8CF} + {E64D31D0-8F38-4FDF-B60D-F955D2475566} = {5B2B5E7E-A2FB-4095-9E79-404BF53E0133} {E7A05515-DABE-4C09-83CB-CE84EFDCD4CC} = {28140562-A65A-48E9-ABAB-53BA939084F0} + {4FA4A9A6-1D38-414B-96F0-3CFB63C687C9} = {F362E63A-2B1A-445B-B198-3071D7DDE8CF} + {A7B7DE04-7261-4D4C-AA78-9F2D9B5A1C37} = {F362E63A-2B1A-445B-B198-3071D7DDE8CF} + {F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C} = {5B2B5E7E-A2FB-4095-9E79-404BF53E0133} {A83A8520-F5E2-49B4-83BC-0F82A412951D} = {28140562-A65A-48E9-ABAB-53BA939084F0} - {F6A8185B-07C6-401D-9B40-3C560239E05F} = {28140562-A65A-48E9-ABAB-53BA939084F0} - {9CF6C6E6-0E9F-4A95-84B5-6083EAB6FA13} = {28140562-A65A-48E9-ABAB-53BA939084F0} - {069C2B51-069A-4FBB-BFE9-42D573F1CEEA} = {28140562-A65A-48E9-ABAB-53BA939084F0} - {9DF0247E-5B81-4EF3-82CA-3E70B3A56742} = {FD72C125-C10D-457B-8AFC-6B4E5237AF6A} - {FB17AC52-1633-4845-932B-9218DF895957} = {FD72C125-C10D-457B-8AFC-6B4E5237AF6A} {3B79DD71-8C2F-41BC-A1A7-86A490D6C726} = {FD72C125-C10D-457B-8AFC-6B4E5237AF6A} {4EE36055-AD7C-4779-B3F6-08687960DCC3} = {FD72C125-C10D-457B-8AFC-6B4E5237AF6A} {C3F25EEF-04B4-407A-960B-0C1CE9C04430} = {FD72C125-C10D-457B-8AFC-6B4E5237AF6A} @@ -539,19 +547,18 @@ Global {1BCCD2F5-A561-4641-8A0B-51F3EDCA35DC} = {FD72C125-C10D-457B-8AFC-6B4E5237AF6A} {0F83B07B-2E3F-4708-BE6D-7A8DA8168803} = {FD72C125-C10D-457B-8AFC-6B4E5237AF6A} {833C1D45-9BBB-4A92-93B7-4EFFD9E945AD} = {FD72C125-C10D-457B-8AFC-6B4E5237AF6A} - {62C2AC8A-7410-4E06-B94E-43BF2DCFBDE9} = {5B2B5E7E-A2FB-4095-9E79-404BF53E0133} - {9C41B325-1225-43CA-9436-549AFF6D90A1} = {5B2B5E7E-A2FB-4095-9E79-404BF53E0133} - {E64D31D0-8F38-4FDF-B60D-F955D2475566} = {5B2B5E7E-A2FB-4095-9E79-404BF53E0133} - {F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C} = {5B2B5E7E-A2FB-4095-9E79-404BF53E0133} {1B4552A4-91FD-4C6F-9EB4-3454C4BE428F} = {5B2B5E7E-A2FB-4095-9E79-404BF53E0133} + {F6A8185B-07C6-401D-9B40-3C560239E05F} = {28140562-A65A-48E9-ABAB-53BA939084F0} + {EC777939-BE30-4ED9-9FE1-451DD7472467} = {F362E63A-2B1A-445B-B198-3071D7DDE8CF} {25E8AB9D-2D10-44F5-9F83-5A5134526771} = {5B2B5E7E-A2FB-4095-9E79-404BF53E0133} + {9CF6C6E6-0E9F-4A95-84B5-6083EAB6FA13} = {28140562-A65A-48E9-ABAB-53BA939084F0} {82728202-1098-4E16-B598-5762EAF67D08} = {5B2B5E7E-A2FB-4095-9E79-404BF53E0133} - {CF79B5AE-38CB-4B80-BF92-CF634C0B7EC3} = {F362E63A-2B1A-445B-B198-3071D7DDE8CF} - {4FA4A9A6-1D38-414B-96F0-3CFB63C687C9} = {F362E63A-2B1A-445B-B198-3071D7DDE8CF} - {A7B7DE04-7261-4D4C-AA78-9F2D9B5A1C37} = {F362E63A-2B1A-445B-B198-3071D7DDE8CF} - {EC777939-BE30-4ED9-9FE1-451DD7472467} = {F362E63A-2B1A-445B-B198-3071D7DDE8CF} + {069C2B51-069A-4FBB-BFE9-42D573F1CEEA} = {28140562-A65A-48E9-ABAB-53BA939084F0} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {19706846-1F47-42ED-B649-B0982EE96E6B} EndGlobalSection + GlobalSection(SharedMSBuildProjectFiles) = preSolution + ..\System.Private.CoreLib\src\System.Private.CoreLib.Shared.projitems*{71ab8240-f179-4b21-a8be-8be6cd774ed9}*SharedItemsImports = 5 + EndGlobalSection EndGlobal diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index 50c7708cdfc74c..848c670d737c8d 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -8737,6 +8737,7 @@ public KoreanLunisolarCalendar() { } public sealed partial class NumberFormatInfo : System.ICloneable, System.IFormatProvider { public NumberFormatInfo() { } + public bool AllowHyphenDuringParsing { get { throw null; } } public int CurrencyDecimalDigits { get { throw null; } set { } } public string CurrencyDecimalSeparator { get { throw null; } set { } } public string CurrencyGroupSeparator { get { throw null; } set { } }