Beispiel #1
0
 /// <summary>
 /// numeric floor, or lowercase
 /// </summary>
 /// <param name="l"></param>
 /// <returns></returns>
 public static CValue Floor(CValue l)
 {
     if (l.IsNumeric) {
         return new CValue(Math.Floor(l.NumericValue));
     }
     return new CValue(l.ToString().ToLower());
 }
Beispiel #2
0
 /// <summary>
 /// Numeric exponent, or NaN
 /// </summary>
 public static CValue Pow(CValue l, CValue r)
 {
     if (l.IsNumeric && r.IsNumeric) {
         return new CValue((decimal)Math.Pow((double)l.NumericValue, (double)r.NumericValue));
     }
     return new CValue();
 }
Beispiel #3
0
 public static CValue Ceil(CValue l)
 {
     if (l.IsNumeric) {
         return new CValue(Math.Ceiling(l.NumericValue));
     }
     return new CValue(l.ToString().ToUpper());
 }