Permalink
Browse files

RootSample - add support for int.MinValue

  • Loading branch information...
bobbymcr committed Aug 28, 2018
1 parent 10b1896 commit c1f7799355c089f48fbeac76f92365479cb94f16
@@ -24,6 +24,13 @@ private RootTerm(int n)
return;
}
if (n == int.MinValue)
{
this.c = 32768;
this.x = -2;
return;
}
bool imag = n < 0;
if (imag)
{
@@ -42,6 +42,9 @@ public sealed class RootTermTest
[InlineData(-2147483644, "2*sqrt(536870911)*i")]
public void FactorsOfFourNeg(int n, string expected) => Test(n, expected);
[Fact]
public void MinValueNeg() => Test(-2147483648, "32768*sqrt(2)*i");
[Theory]
[InlineData(18, "3*sqrt(2)")]
[InlineData(243, "9*sqrt(3)")]

0 comments on commit c1f7799

Please sign in to comment.