示例#1
0
文件: Numeric.cs 项目: yyyyj/ironruby
        public static object Div(BinaryOpStorage /*!*/ divideStorage, ConversionStorage <double> /*!*/ tofStorage, object self, object other)
        {
            var divide = divideStorage.GetCallSite("/");
            var tof    = tofStorage.GetSite(ConvertToFAction.Make(tofStorage.Context));

            return(ClrFloat.Floor(tof.Target(tof, divide.Target(divide, self, other))));
        }
示例#2
0
        public static object Compare(RubyContext /*!*/ context, BigInteger /*!*/ self, double other)
        {
            var result = ClrFloat.Compare(context, other, self);

            if (result == null)
            {
                return(null);
            }

            int i = (int)result;

            return((i == 0) ? ClrInteger.Zero : (i < 0) ? ClrInteger.One : ClrInteger.MinusOne);
        }
示例#3
0
 public static object Compare(RubyContext /*!*/ context, BigInteger /*!*/ self, double other)
 {
     return(ClrFloat.Compare(ToFloat(context, self), other));
 }
示例#4
0
文件: Numeric.cs 项目: yyyyj/ironruby
 public static object Truncate([DefaultProtocol] double self)
 {
     return(ClrFloat.ToInt(self));
 }
示例#5
0
文件: Numeric.cs 项目: yyyyj/ironruby
 public static object Ceil([DefaultProtocol] double self)
 {
     return(ClrFloat.Ceil(self));
 }
示例#6
0
文件: Numeric.cs 项目: yyyyj/ironruby
 public static object Floor([DefaultProtocol] double self)
 {
     return(ClrFloat.Floor(self));
 }
示例#7
0
文件: Numeric.cs 项目: yyyyj/ironruby
 public static object Round([DefaultProtocol] double self)
 {
     return(ClrFloat.Round(self));
 }