Ejemplo n.º 1
0
 public DyObject Max(ExecutionContext ctx, DyObject x, DyObject y)
 {
     if (x.Type(ctx).Gt(ctx, x, y).GetBool())
     {
         return(x);
     }
     else
     {
         return(y);
     }
 }
Ejemplo n.º 2
0
        public DyObject Sign(ExecutionContext ctx, DyObject x)
        {
            if (x == DyInteger.Zero)
            {
                return(DyInteger.Zero);
            }

            if (x.Type(ctx).Lt(ctx, x, DyInteger.Zero).GetBool())
            {
                return(DyInteger.MinusOne);
            }
            else
            {
                return(DyInteger.One);
            }
        }