 
 
   "FLOOR.MATH": (args)->
-    @checkArgumentSize(args, 2, 3)
+    @checkArgumentSize(args, 1, 3)
+    if args.length == 1
+      args.push 1
     expr = @expectNumber(args[0])
     digit = Math.abs(@expectNumber(args[1]))
     sign = 1

ERROR_NULL = "#NULL!"
ERROR_VALUE = "#VALUE!"

class FormulaEvaluator

  constructor: (@worksheet)->



  SUM: (args)->
    sum = 0
    args = [].concat(args)
    for expr in args
      if expr instanceof Range
        expr.each (r, c)=>
          cell = @worksheet.getCell(r, c);
          val = cell.value
          if cell.formula
            val = @expectNumber(cell.calculate())
          if Utils.isNumber(val)
            sum += Number(val)
      else
        sum += @expectNumber(expr)
    sum



  expectNumber:(x)->
    x = @getValue(x)
    if x == undefined
      return Number(0)
    unless Utils.isNumber(x)
      @error(ERROR_VALUE)
    Number(x)

  expectInteger:(x)->
    parseInt @expectNumber(x)

  expectString:(x)->
    x = @getValue(x)
