ToDouble() public method

public ToDouble ( IFormatProvider provider ) : double
provider IFormatProvider
return double
Ejemplo n.º 1
0
 public void ToDoubleWorks()
 {
     BigInteger n1 = BigInteger.Create(1);
     BigInteger d1 = BigInteger.Create(3);
     Ratio r1 = new Ratio(n1, d1);
     BigDecimal.Context c = new BigDecimal.Context(6, BigDecimal.RoundingMode.HalfUp);
     double d = r1.ToDouble(null);
     Expect(d, EqualTo(0.3333333333333333));  // precision = 16
 }
Ejemplo n.º 2
0
 public void ToDoubleWorks()
 {
     BigInteger n1 = BigInteger.Create(1);
     BigInteger d1 = BigInteger.Create(3);
     Ratio r1 = new Ratio(n1, d1);
     double d = r1.ToDouble(null);
     Expect(d, EqualTo(0.3333333333333333));  // precision = 16
 }