Beispiel #1
0
 public static NeoNumber Reify(double value)
 {
     if (value % 1 == 0)
     {
         return(NeoInt.ValueOf((int)value));
     }
     else
     {
         return(NeoFloat.ValueOf(value));
     }
 }
Beispiel #2
0
        public override NeoValue Length()
        {
            var mm = GetMetaMethod("__length");

            if (mm != null)
            {
                return(mm.Call(new [] { this }));
            }
            else
            {
                return(NeoInt.ValueOf(data.Count));
            }
        }
Beispiel #3
0
 public override NeoValue Length() => NeoInt.ValueOf(data.Count);
Beispiel #4
0
 public override NeoValue BitXor(NeoValue other)
 {
     return(NeoInt.ValueOf(AsInt ^ other.CheckNumber().AsInt));
 }
Beispiel #5
0
 public override NeoValue BitNot()
 {
     return(NeoInt.ValueOf(~AsInt));
 }
Beispiel #6
0
 public override NeoValue Rsh(NeoValue other)
 {
     return(NeoInt.ValueOf(AsInt >> other.CheckNumber().AsInt));
 }
Beispiel #7
0
 public override NeoValue Length() => NeoInt.ValueOf(Scope.LocalCount);