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

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