ToDouble() public méthode

public ToDouble ( IFormatProvider provider ) : double
provider IFormatProvider
Résultat double
Exemple #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
 }
Exemple #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
 }