Beispiel #1
0
 public void FloatFitsLong()
 {
     using (var a = new HugeFloat(long.MaxValue))
         using (var small = new HugeFloat(0.0001))
         {
             Assert.IsTrue(a.FitsLong());
             a.Value = a + 1;
             Assert.IsFalse(a.FitsLong());
             a.Value = a - small;
             Assert.IsTrue(a.FitsLong());
             a.SetTo(long.MinValue);
             Assert.IsTrue(a.FitsLong());
             a.Value = a - 1;
             Assert.IsFalse(a.FitsLong());
             a.Value = a + small;
             Assert.IsTrue(a.FitsLong());
         }
 }