public void Test_ToDouble() { SignedRational rational = new SignedRational(0, 0); Assert.AreEqual(double.NaN, rational.ToDouble()); rational = new SignedRational(2, 0); Assert.AreEqual(double.PositiveInfinity, rational.ToDouble()); rational = new SignedRational(-2, 0); Assert.AreEqual(double.NegativeInfinity, rational.ToDouble()); }
public void Test_ToDouble() { SignedRational rational = new SignedRational(0, 0); Assert.AreEqual(double.NaN, rational.ToDouble()); rational = new SignedRational(2, 0); Assert.AreEqual(double.PositiveInfinity, rational.ToDouble()); rational = new SignedRational(-2, 0); Assert.AreEqual(double.NegativeInfinity, rational.ToDouble()); }
public void ShouldReturnNegativeInfinityWhenDenominatorIsZeroAndValueIsNegative() { var rational = new SignedRational(-2, 0); Assert.Equal(double.NegativeInfinity, rational.ToDouble()); }
public void ShouldReturnPositiveInfinityWhenDenominatorIsZero() { var rational = new SignedRational(2, 0); Assert.Equal(double.PositiveInfinity, rational.ToDouble()); }
public void ShouldReturnNanWhenNumeratorIsZero() { var rational = new SignedRational(0, 0); Assert.Equal(double.NaN, rational.ToDouble()); }