mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-22 19:18:46 +00:00
Add tests for ComplexInfinity
This commit is contained in:
parent
8008a4a9ef
commit
d9277dbbf6
@ -1,4 +1,5 @@
|
||||
using System.Diagnostics;
|
||||
using System.Numerics;
|
||||
|
||||
namespace X10D.Tests.Core;
|
||||
|
||||
@ -11,6 +12,22 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
[TestClass]
|
||||
public class DoubleTests
|
||||
{
|
||||
[TestMethod]
|
||||
public void ComplexSqrt()
|
||||
{
|
||||
Assert.AreEqual(0.0, 0.0.ComplexSqrt());
|
||||
Assert.AreEqual(1.414213562373095, 2.0.ComplexSqrt());
|
||||
Assert.AreEqual(3.0, 9.0.ComplexSqrt());
|
||||
Assert.AreEqual(4.0, 16.0.ComplexSqrt());
|
||||
Assert.AreEqual(new Complex(1.414213562373095, 1), (-2.0).ComplexSqrt());
|
||||
Assert.AreEqual(new Complex(3.0, 1), (-9.0).ComplexSqrt());
|
||||
Assert.AreEqual(new Complex(4.0, 1), (-16.0).ComplexSqrt());
|
||||
Assert.AreEqual(Complex.NaN, double.NaN.ComplexSqrt());
|
||||
Assert.AreEqual(new Complex(1, 1), (-1.0).ComplexSqrt());
|
||||
Assert.AreEqual(Complex.Infinity, double.NegativeInfinity.ComplexSqrt());
|
||||
Assert.AreEqual(Complex.Infinity, double.PositiveInfinity.ComplexSqrt());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test for <see cref="DoubleExtensions.LerpTo" />
|
||||
/// </summary>
|
||||
|
@ -1,10 +1,27 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System.Numerics;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace X10D.Tests.Core;
|
||||
|
||||
[TestClass]
|
||||
public class SingleTests
|
||||
{
|
||||
[TestMethod]
|
||||
public void ComplexSqrt()
|
||||
{
|
||||
Assert.AreEqual(0.0f, 0.0f.ComplexSqrt());
|
||||
Assert.AreEqual(1.4142135f, 2.0f.ComplexSqrt());
|
||||
Assert.AreEqual(3.0f, 9.0f.ComplexSqrt());
|
||||
Assert.AreEqual(4.0f, 16.0f.ComplexSqrt());
|
||||
Assert.AreEqual(new Complex(1.4142135f, 1), (-2.0f).ComplexSqrt());
|
||||
Assert.AreEqual(new Complex(3.0f, 1), (-9.0f).ComplexSqrt());
|
||||
Assert.AreEqual(new Complex(4.0f, 1), (-16.0f).ComplexSqrt());
|
||||
Assert.AreEqual(Complex.NaN, float.NaN.ComplexSqrt());
|
||||
Assert.AreEqual(new Complex(1, 1), (-1.0f).ComplexSqrt());
|
||||
Assert.AreEqual(Complex.Infinity, float.NegativeInfinity.ComplexSqrt());
|
||||
Assert.AreEqual(Complex.Infinity, float.PositiveInfinity.ComplexSqrt());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void DegreesToRadians()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user