Skip to content

Commit 0cea6ff

Browse files
authored
Allow input params as output params (#44)
1 parent 7194cfd commit 0cea6ff

File tree

8 files changed

+249
-60
lines changed

8 files changed

+249
-60
lines changed

src/Nethermind.Int256.Benchmark/Numbers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public static class Numbers
1212
public static readonly BigInteger TwoTo256 = TwoTo128 * TwoTo128;
1313
public static readonly BigInteger UInt256Max = TwoTo256 - 1;
1414

15-
public static readonly BigInteger Int256Max = ( BigInteger.One << 255 ) - 1;
15+
public static readonly BigInteger Int256Max = (BigInteger.One << 255) - 1;
1616
public static readonly BigInteger Int256Min = -Int256Max;
1717
}
1818
}

src/Nethermind.Int256.Test/Convertibles.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ public static (Type type, BigInteger? min, BigInteger? max)[] ConvertibleTypes =
7676
(typeof(decimal), (BigInteger?)decimal.MinValue, (BigInteger?)decimal.MaxValue),
7777
(typeof(BigInteger), null, null)
7878
};
79-
79+
8080
public static IEnumerable<TestCaseData> TestCases => GenerateTestCases(Numbers, BigInteger.Zero);
8181
public static IEnumerable<TestCaseData> SignedTestCases => GenerateTestCases(SignedNumbers);
82-
82+
8383
private static IEnumerable<TestCaseData> GenerateTestCases(IEnumerable<(object, string)> numbers, BigInteger? minValue = null)
8484
{
8585
Type ExpectedException(BigInteger value, BigInteger? min, BigInteger? max) =>

src/Nethermind.Int256.Test/Int256Tests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ string Expected(string valueString)
6363
{
6464
if (valueString.Contains("Infinity"))
6565
{
66-
return valueString.StartsWith('-') ? "-∞" : "∞" ;
66+
return valueString.StartsWith('-') ? "-∞" : "∞";
6767
}
6868
string expected = valueString.Replace(",", "");
6969
return type == typeof(float) ? expected[..Math.Min(6, expected.Length)] : type == typeof(double) ? expected[..Math.Min(14, expected.Length)] : expected;
@@ -77,7 +77,7 @@ string Expected(string valueString)
7777
string convertedValue = Expected(((IFormattable)System.Convert.ChangeType(item, type)).ToString("0.#", null));
7878
convertedValue.Should().BeEquivalentTo(expected);
7979
}
80-
catch (Exception e) when(e.GetType() == expectedException) { }
80+
catch (Exception e) when (e.GetType() == expectedException) { }
8181
}
8282
}
8383
}

src/Nethermind.Int256.Test/TestNumbers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public static class TestNumbers
1212
public static readonly BigInteger TwoTo256 = TwoTo128 * TwoTo128;
1313
public static readonly BigInteger UInt256Max = TwoTo256 - 1;
1414

15-
public static readonly BigInteger Int256Max = (BigInteger.One << 255)-1;
15+
public static readonly BigInteger Int256Max = (BigInteger.One << 255) - 1;
1616
public static readonly BigInteger Int256Min = -Int256Max;
1717
}
1818
}

0 commit comments

Comments
 (0)