本文整理汇总了C#中Microsoft.Scripting.Math.BigInteger.ToFloat64方法的典型用法代码示例。如果您正苦于以下问题:C# BigInteger.ToFloat64方法的具体用法?C# BigInteger.ToFloat64怎么用?C# BigInteger.ToFloat64使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Scripting.Math.BigInteger
的用法示例。
在下文中一共展示了BigInteger.ToFloat64方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConvertToDouble
public static double ConvertToDouble(BigInteger self) {
return self.ToFloat64();
}
示例2: ToFloat
public static float ToFloat(BigInteger/*!*/ self) {
return checked((float)self.ToFloat64());
}
示例3: ToFloat
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: __float__
public static object __float__(BigInteger self) {
return self.ToFloat64();
}
示例5: Power
public static object Power(BigInteger/*!*/ self, double exponent) {
return System.Math.Pow(self.ToFloat64(), exponent);
}
示例6: Add
public static object Add(BigInteger/*!*/ self, double other) {
return self.ToFloat64() + other;
}
示例7: Quotient
public static object Quotient(BigInteger/*!*/ self, double other) {
return self.ToFloat64() / other;
}
示例8: Subtract
public static object Subtract(BigInteger/*!*/ self, double other) {
return self.ToFloat64() - other;
}
示例9: Multiply
public static object Multiply(BigInteger/*!*/ self, double other) {
return self.ToFloat64() * other;
}
示例10: ConvertToDouble
public static double ConvertToDouble(BigInteger self) {
if (object.ReferenceEquals(self, null)) {
throw new ArgumentNullException("self");
}
return self.ToFloat64();
}
示例11: ConvertBignumToFloat
public static double ConvertBignumToFloat(BigInteger/*!*/ value) {
return value.ToFloat64();
}
示例12: Remainder
public static double Remainder(BigInteger/*!*/ self, double other) {
return self.ToFloat64() % other;
}
示例13: DivMod
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);
}
示例14: DivideOp
public static object DivideOp(BigInteger/*!*/ self, double other) {
return self.ToFloat64() / other;
}