mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-09 22:55:42 +00:00
Add Sqrt tests
This commit is contained in:
parent
4855ae8bf2
commit
9b9b75ae5b
@ -102,4 +102,17 @@ public class DoubleTests
|
||||
Assert.AreEqual(5.0, 7.0.Round(5));
|
||||
Assert.AreEqual(10.0, 7.5.Round(5));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Sqrt()
|
||||
{
|
||||
Assert.AreEqual(0.0, 0.0.Sqrt());
|
||||
Assert.AreEqual(1.414213562373095, 2.0.Sqrt());
|
||||
Assert.AreEqual(3.0, 9.0.Sqrt());
|
||||
Assert.AreEqual(4.0, 16.0.Sqrt());
|
||||
Assert.AreEqual(double.NaN, double.NaN.Sqrt());
|
||||
Assert.AreEqual(double.NaN, (-1.0).Sqrt());
|
||||
Assert.AreEqual(double.NaN, double.NegativeInfinity.Sqrt());
|
||||
Assert.AreEqual(double.PositiveInfinity, double.PositiveInfinity.Sqrt());
|
||||
}
|
||||
}
|
||||
|
@ -26,4 +26,17 @@ public class SingleTests
|
||||
Assert.AreEqual(6.0f, 0.10471976f.RadiansToDegrees());
|
||||
Assert.AreEqual(12.0f, 0.20943952f.RadiansToDegrees());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Sqrt()
|
||||
{
|
||||
Assert.AreEqual(0.0f, 0.0f.Sqrt());
|
||||
Assert.AreEqual(1.4142135f, 2.0f.Sqrt());
|
||||
Assert.AreEqual(3.0f, 9.0f.Sqrt());
|
||||
Assert.AreEqual(4.0f, 16.0f.Sqrt());
|
||||
Assert.AreEqual(float.NaN, float.NaN.Sqrt());
|
||||
Assert.AreEqual(float.NaN, (-1.0f).Sqrt());
|
||||
Assert.AreEqual(float.NaN, float.NegativeInfinity.Sqrt());
|
||||
Assert.AreEqual(float.PositiveInfinity, float.PositiveInfinity.Sqrt());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user