Exemplo n.º 1
0
 public static NeoValue ParseNumber(NeoValue[] args)
 {
     if (args.Length != 1)
     {
         throw new NeoError("float expects a single string argument");                              // @TODO @Untested
     }
     return(NeoNumber.Reify(double.Parse(args[0].CheckString().Value)));
 }
Exemplo n.º 2
0
 public static NeoValue Sqrt(NeoValue[] args)
 {
     if (args.Length != 1)
     {
         throw new NeoError("sqrt expects a single numeric argument");                              // @TODO @Untested
     }
     return(NeoNumber.Reify(Math.Sqrt(args[0].CheckNumber().AsDouble)));
 }