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

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