Permalink
Browse files

RootSample - irreducible composite

  • Loading branch information...
bobbymcr committed Aug 27, 2018
1 parent 1d14b27 commit ed1b8d9b5c7936b944a30de6dff719d9e2821e8f
@@ -62,7 +62,11 @@ public override string ToString()
if (this.x > 1)
{
sb.Append('*');
if (sb.Length != 0)
{
sb.Append('*');
}
sb.Append("sqrt(");
sb.Append(this.x);
sb.Append(')');
@@ -49,5 +49,16 @@ public void FactorsOfTwentyFive(int n, string expected)
{
new RootTerm(n).ToString().Should().Be(expected, "sqrt({0}) is {1}", n, expected);
}
[Theory]
[InlineData(6, "sqrt(6)")]
[InlineData(15, "sqrt(15)")]
[InlineData(10002, "sqrt(10002)")]
[InlineData(223092870, "sqrt(223092870)")]
[InlineData(2147483642, "sqrt(2147483642)")]
public void IrreducibleComposite(int n, string expected)
{
new RootTerm(n).ToString().Should().Be(expected, "sqrt({0}) is {1}", n, expected);
}
}
}

0 comments on commit ed1b8d9

Please sign in to comment.