Exemple #1
0
 public void FloatFitsShort()
 {
     using (var a = new HugeFloat(short.MaxValue))
         using (var small = new HugeFloat(0.0001))
         {
             Assert.IsTrue(a.FitsShort());
             a.Value = a + 1;
             Assert.IsFalse(a.FitsShort());
             a.Value = a - small;
             Assert.IsTrue(a.FitsShort());
             a.SetTo(short.MinValue);
             Assert.IsTrue(a.FitsShort());
             a.Value = a - 1;
             Assert.IsFalse(a.FitsShort());
             a.Value = a + small;
             Assert.IsTrue(a.FitsShort());
         }
 }