public void DoubleComponents_PreservesValue() { double d = 0.25; var dstr = d.ToExactString(); var dc = new DoubleComponents(d); var dcValue = (dc.Negative ? -1.0 : 1.0) * dc.Mantissa * Math.Pow(2.0, dc.Exponent); Assert.AreEqual(d, dcValue); }
public void DoubleComponents_PreservesValue() { double d = 0.25; var dstr = d.ToExactString(); var dc = new DoubleComponents(d); var dcValue = (dc.Negative ? -1.0 : 1.0) * dc.Mantissa * Math.Pow(2.0, dc.Exponent); Assert.AreEqual(d, dcValue); }