ToFloat64() 공개 메소드

public ToFloat64 ( ) : double
리턴 double
예제 #1
0
 public static double ConvertToDouble(BigInteger self) {
     return self.ToFloat64();
 }
예제 #2
0
 public static float ToFloat(BigInteger/*!*/ self) {
     return checked((float)self.ToFloat64());
 }
예제 #3
0
 public static double ToFloat(RubyContext/*!*/ context, BigInteger/*!*/ self) {
     try {
         return self.ToFloat64();
     } catch (OverflowException) {
         // If the BigInteger is too big for a float then we return infinity.
         context.ReportWarning("Bignum out of Float range");
         return self.Sign > 0 ? Double.PositiveInfinity : Double.NegativeInfinity;
     }
 }
예제 #4
0
 public static object __float__(BigInteger self) {
     return self.ToFloat64();
 }
예제 #5
0
 public static object Power(BigInteger/*!*/ self, double exponent) {
     return System.Math.Pow(self.ToFloat64(), exponent);
 }
예제 #6
0
 public static object Add(BigInteger/*!*/ self, double other) {
     return self.ToFloat64() + other;
 }
예제 #7
0
 public static object Quotient(BigInteger/*!*/ self, double other) {
     return self.ToFloat64() / other;
 }
예제 #8
0
 public static object Power(RubyContext/*!*/ context, BigInteger/*!*/ self, [NotNull]BigInteger/*!*/ exponent) {
     context.ReportWarning("in a**b, b may be too big");
     double result = System.Math.Pow(self.ToFloat64(), exponent.ToFloat64());
     return result;
 }
예제 #9
0
 public static object Subtract(BigInteger/*!*/ self, double other) {
     return self.ToFloat64() - other;
 }
예제 #10
0
 public static object Multiply(BigInteger/*!*/ self, double other) {
     return self.ToFloat64() * other;
 }
예제 #11
0
파일: LongOps.cs 프로젝트: atczyc/ironruby
 public static double ConvertToDouble(BigInteger self) {
     if (object.ReferenceEquals(self, null)) {
         throw new ArgumentNullException("self");
     }
     return self.ToFloat64();
 }
예제 #12
0
파일: RubyOps.cs 프로젝트: tnachen/ironruby
 public static double ConvertBignumToFloat(BigInteger/*!*/ value) {
     return value.ToFloat64();
 }
예제 #13
0
 public static double Remainder(BigInteger/*!*/ self, double other) {
     return self.ToFloat64() % other;
 }
예제 #14
0
        public static RubyArray DivMod(BigInteger/*!*/ self, double other) {
            if (other == 0.0) {
                throw new FloatDomainError("NaN");
            }

            double selfFloat = self.ToFloat64();
            BigInteger div = BigInteger.Create(selfFloat / other);
            double mod = selfFloat % other;

            return RubyOps.MakeArray2(Protocols.Normalize(div), mod);
        }
예제 #15
0
 public static object DivideOp(BigInteger/*!*/ self, double other) {
     return self.ToFloat64() / other;
 }