@@ -1586,7 +1586,7 @@ public static IEnumerable<object[]> ToSingle_String_TestData()
15861586 yield return new object [ ] { " &o5" , ( float ) 5 } ;
15871587 yield return new object [ ] { "&o0" , ( float ) 0 } ;
15881588 yield return new object [ ] { 1.1 . ToString ( ) , ( float ) 1.1 } ;
1589- yield return new object [ ] { "18446744073709551616" , float . Parse ( "1.844674E+19" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1589+ yield return new object [ ] { "18446744073709551616" , 18446744073709551616.0f } ;
15901590 yield return new object [ ] { double . PositiveInfinity . ToString ( ) , float . PositiveInfinity } ;
15911591 yield return new object [ ] { double . NegativeInfinity . ToString ( ) , float . NegativeInfinity } ;
15921592 yield return new object [ ] { double . NaN . ToString ( ) , float . NaN } ;
@@ -1663,42 +1663,42 @@ public static IEnumerable<object[]> ToSingle_Object_TestData()
16631663 // uint.
16641664 yield return new object [ ] { uint . MinValue , ( float ) 0 } ;
16651665 yield return new object [ ] { ( uint ) 1 , ( float ) 1 } ;
1666- yield return new object [ ] { uint . MaxValue , float . Parse ( "4.294967E+09" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1666+ yield return new object [ ] { uint . MaxValue , ( float ) uint . MaxValue } ;
16671667 yield return new object [ ] { ( UIntEnum ) uint . MinValue , ( float ) 0 } ;
16681668 yield return new object [ ] { ( UIntEnum ) 1 , ( float ) 1 } ;
1669- yield return new object [ ] { ( UIntEnum ) uint . MaxValue , float . Parse ( "4.294967E+09" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1669+ yield return new object [ ] { ( UIntEnum ) uint . MaxValue , ( float ) uint . MaxValue } ;
16701670
16711671 // int.
1672- yield return new object [ ] { int . MinValue , float . Parse ( "-2.147484E+09" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1672+ yield return new object [ ] { int . MinValue , ( float ) int . MinValue } ;
16731673 yield return new object [ ] { - 1 , ( float ) ( - 1 ) } ;
16741674 yield return new object [ ] { 0 , ( float ) 0 } ;
16751675 yield return new object [ ] { 1 , ( float ) 1 } ;
1676- yield return new object [ ] { int . MaxValue , float . Parse ( "2.147484E+09" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1677- yield return new object [ ] { ( IntEnum ) int . MinValue , float . Parse ( "-2.147484E+09" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1676+ yield return new object [ ] { int . MaxValue , ( float ) int . MaxValue } ;
1677+ yield return new object [ ] { ( IntEnum ) int . MinValue , ( float ) int . MinValue } ;
16781678 yield return new object [ ] { ( IntEnum ) ( - 1 ) , ( float ) ( - 1 ) } ;
16791679 yield return new object [ ] { ( IntEnum ) 0 , ( float ) 0 } ;
16801680 yield return new object [ ] { ( IntEnum ) 1 , ( float ) 1 } ;
1681- yield return new object [ ] { ( IntEnum ) int . MaxValue , float . Parse ( "2.147484E+09" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1681+ yield return new object [ ] { ( IntEnum ) int . MaxValue , ( float ) int . MaxValue } ;
16821682
16831683 // ulong.
16841684 yield return new object [ ] { ulong . MinValue , ( float ) 0 } ;
16851685 yield return new object [ ] { ( ulong ) 1 , ( float ) 1 } ;
1686- yield return new object [ ] { ulong . MaxValue , float . Parse ( "1.844674E+19" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1686+ yield return new object [ ] { ulong . MaxValue , ( float ) ulong . MaxValue } ;
16871687 yield return new object [ ] { ( ULongEnum ) ulong . MinValue , ( float ) 0 } ;
16881688 yield return new object [ ] { ( ULongEnum ) 1 , ( float ) 1 } ;
1689- yield return new object [ ] { ( ULongEnum ) ulong . MaxValue , float . Parse ( "1.844674E+19" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1689+ yield return new object [ ] { ( ULongEnum ) ulong . MaxValue , ( float ) ulong . MaxValue } ;
16901690
16911691 // long.
1692- yield return new object [ ] { long . MinValue , float . Parse ( "-9.223372E+18" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1692+ yield return new object [ ] { long . MinValue , ( float ) long . MinValue } ;
16931693 yield return new object [ ] { ( long ) ( - 1 ) , ( float ) ( - 1 ) } ;
16941694 yield return new object [ ] { ( long ) 0 , ( float ) 0 } ;
16951695 yield return new object [ ] { ( long ) 1 , ( float ) 1 } ;
1696- yield return new object [ ] { long . MaxValue , float . Parse ( "9.223372E+18" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1697- yield return new object [ ] { ( LongEnum ) long . MinValue , float . Parse ( "-9.223372E+18" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1696+ yield return new object [ ] { long . MaxValue , ( float ) long . MaxValue } ;
1697+ yield return new object [ ] { ( LongEnum ) long . MinValue , ( float ) long . MinValue } ;
16981698 yield return new object [ ] { ( LongEnum ) ( - 1 ) , ( float ) ( - 1 ) } ;
16991699 yield return new object [ ] { ( LongEnum ) 0 , ( float ) 0 } ;
17001700 yield return new object [ ] { ( LongEnum ) 1 , ( float ) 1 } ;
1701- yield return new object [ ] { ( LongEnum ) long . MaxValue , float . Parse ( "9.223372E+18" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1701+ yield return new object [ ] { ( LongEnum ) long . MaxValue , ( float ) long . MaxValue } ;
17021702
17031703 // float.
17041704 yield return new object [ ] { float . MinValue , float . MinValue } ;
@@ -1721,11 +1721,11 @@ public static IEnumerable<object[]> ToSingle_Object_TestData()
17211721 yield return new object [ ] { double . NaN , float . NaN } ;
17221722
17231723 // decimal.
1724- yield return new object [ ] { decimal . MinValue , float . Parse ( "-7.922816E+28" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1724+ yield return new object [ ] { decimal . MinValue , ( float ) decimal . MinValue } ;
17251725 yield return new object [ ] { ( decimal ) ( - 1 ) , ( float ) ( - 1 ) } ;
17261726 yield return new object [ ] { ( decimal ) 0 , ( float ) 0 } ;
17271727 yield return new object [ ] { ( decimal ) 1 , ( float ) 1 } ;
1728- yield return new object [ ] { decimal . MaxValue , float . Parse ( "7.922816E+28" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1728+ yield return new object [ ] { decimal . MaxValue , ( float ) decimal . MaxValue } ;
17291729
17301730 // bool.
17311731 yield return new object [ ] { true , ( float ) ( - 1 ) } ;
@@ -1790,8 +1790,8 @@ public static IEnumerable<object[]> ToDouble_String_TestData()
17901790 yield return new object [ ] { " &o5" , ( double ) 5 } ;
17911791 yield return new object [ ] { "&o0" , ( double ) 0 } ;
17921792 yield return new object [ ] { 1.1 . ToString ( ) , ( double ) 1.1 } ;
1793- yield return new object [ ] { "18446744073709551616" , double . Parse ( "1.84467440737096E+19" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1794- yield return new object [ ] { "1844674407370955161618446744073709551616" , double . Parse ( "1.84467440737096E+39" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1793+ yield return new object [ ] { "18446744073709551616" , 18446744073709551616.0 } ;
1794+ yield return new object [ ] { "1844674407370955161618446744073709551616" , 1844674407370955161618446744073709551616.0 } ;
17951795 yield return new object [ ] { double . PositiveInfinity . ToString ( ) , double . PositiveInfinity } ;
17961796 yield return new object [ ] { double . NegativeInfinity . ToString ( ) , double . NegativeInfinity } ;
17971797 yield return new object [ ] { double . NaN . ToString ( ) , double . NaN } ;
@@ -1876,29 +1876,29 @@ public static IEnumerable<object[]> ToDouble_Object_TestData()
18761876 // ulong.
18771877 yield return new object [ ] { ulong . MinValue , ( double ) 0 } ;
18781878 yield return new object [ ] { ( ulong ) 1 , ( double ) 1 } ;
1879- yield return new object [ ] { ulong . MaxValue , double . Parse ( "1.84467440737096E+19" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1879+ yield return new object [ ] { ulong . MaxValue , ( double ) ulong . MaxValue } ;
18801880 yield return new object [ ] { ( ULongEnum ) ulong . MinValue , ( double ) 0 } ;
18811881 yield return new object [ ] { ( ULongEnum ) 1 , ( double ) 1 } ;
1882- yield return new object [ ] { ( ULongEnum ) ulong . MaxValue , double . Parse ( "1.84467440737096E+19" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1882+ yield return new object [ ] { ( ULongEnum ) ulong . MaxValue , ( double ) ulong . MaxValue } ;
18831883
18841884 // long.
1885- yield return new object [ ] { long . MinValue , double . Parse ( "-9.22337203685478E+18" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1885+ yield return new object [ ] { long . MinValue , ( double ) long . MinValue } ;
18861886 yield return new object [ ] { ( long ) ( - 1 ) , ( double ) ( - 1 ) } ;
18871887 yield return new object [ ] { ( long ) 0 , ( double ) 0 } ;
18881888 yield return new object [ ] { ( long ) 1 , ( double ) 1 } ;
1889- yield return new object [ ] { long . MaxValue , double . Parse ( "9.22337203685478E+18" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1890- yield return new object [ ] { ( LongEnum ) long . MinValue , double . Parse ( "-9.22337203685478E+18" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1889+ yield return new object [ ] { long . MaxValue , ( double ) long . MaxValue } ;
1890+ yield return new object [ ] { ( LongEnum ) long . MinValue , ( double ) long . MinValue } ;
18911891 yield return new object [ ] { ( LongEnum ) ( - 1 ) , ( double ) ( - 1 ) } ;
18921892 yield return new object [ ] { ( LongEnum ) 0 , ( double ) 0 } ;
18931893 yield return new object [ ] { ( LongEnum ) 1 , ( double ) 1 } ;
1894- yield return new object [ ] { ( LongEnum ) long . MaxValue , double . Parse ( "9.22337203685478E+18" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1894+ yield return new object [ ] { ( LongEnum ) long . MaxValue , ( double ) long . MaxValue } ;
18951895
18961896 // float.
1897- yield return new object [ ] { float . MinValue , double . Parse ( "-3.40282346638529E+38" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1897+ yield return new object [ ] { float . MinValue , ( double ) float . MinValue } ;
18981898 yield return new object [ ] { ( float ) ( - 1 ) , ( double ) ( - 1 ) } ;
18991899 yield return new object [ ] { ( float ) 0 , ( double ) 0 } ;
19001900 yield return new object [ ] { ( float ) 1 , ( double ) 1 } ;
1901- yield return new object [ ] { float . MaxValue , double . Parse ( "3.40282346638529E+38" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1901+ yield return new object [ ] { float . MaxValue , ( double ) float . MaxValue } ;
19021902 yield return new object [ ] { float . PositiveInfinity , double . PositiveInfinity } ;
19031903 yield return new object [ ] { float . NegativeInfinity , double . NegativeInfinity } ;
19041904 yield return new object [ ] { float . NaN , double . NaN } ;
@@ -1914,11 +1914,11 @@ public static IEnumerable<object[]> ToDouble_Object_TestData()
19141914 yield return new object [ ] { double . NaN , double . NaN } ;
19151915
19161916 // decimal.
1917- yield return new object [ ] { decimal . MinValue , double . Parse ( "-7.92281625142643E+28" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1917+ yield return new object [ ] { decimal . MinValue , ( double ) decimal . MinValue } ;
19181918 yield return new object [ ] { ( decimal ) ( - 1 ) , ( double ) ( - 1 ) } ;
19191919 yield return new object [ ] { ( decimal ) 0 , ( double ) 0 } ;
19201920 yield return new object [ ] { ( decimal ) 1 , ( double ) 1 } ;
1921- yield return new object [ ] { decimal . MaxValue , double . Parse ( "7.92281625142643E+28" , NumberStyles . Any , CultureInfo . InvariantCulture ) } ;
1921+ yield return new object [ ] { decimal . MaxValue , ( double ) decimal . MaxValue } ;
19221922
19231923 // bool.
19241924 yield return new object [ ] { true , ( double ) ( - 1 ) } ;
@@ -1980,7 +1980,7 @@ public static IEnumerable<object[]> ToDecimal_String_TestData()
19801980 yield return new object [ ] { " &o5" , ( decimal ) 5 } ;
19811981 yield return new object [ ] { "&o0" , ( decimal ) 0 } ;
19821982 yield return new object [ ] { 1.1 . ToString ( ) , ( decimal ) 1.1 } ;
1983- yield return new object [ ] { "18446744073709551616" , decimal . Parse ( " 18446744073709551616" , CultureInfo . InvariantCulture ) } ;
1983+ yield return new object [ ] { "18446744073709551616" , 18446744073709551616.0m } ;
19841984 }
19851985
19861986 [ Theory ]
@@ -2082,10 +2082,10 @@ public static IEnumerable<object[]> ToDecimal_Object_TestData()
20822082 // ulong.
20832083 yield return new object [ ] { ulong . MinValue , ( decimal ) 0 } ;
20842084 yield return new object [ ] { ( ulong ) 1 , ( decimal ) 1 } ;
2085- yield return new object [ ] { ulong . MaxValue , decimal . Parse ( "18446744073709551615" , CultureInfo . InvariantCulture ) } ;
2085+ yield return new object [ ] { ulong . MaxValue , ( decimal ) ulong . MaxValue } ;
20862086 yield return new object [ ] { ( ULongEnum ) ulong . MinValue , ( decimal ) 0 } ;
20872087 yield return new object [ ] { ( ULongEnum ) 1 , ( decimal ) 1 } ;
2088- yield return new object [ ] { ( ULongEnum ) ulong . MaxValue , decimal . Parse ( "18446744073709551615" , CultureInfo . InvariantCulture ) } ;
2088+ yield return new object [ ] { ( ULongEnum ) ulong . MaxValue , ( decimal ) ulong . MaxValue } ;
20892089
20902090 // long.
20912091 yield return new object [ ] { long . MinValue , ( decimal ) ( - 9223372036854775808 ) } ;
0 commit comments