#include <config.h>
#include <functions/Divide.h>
#include <sarray/SArray.h>

using std::vector;

Divide::Divide ():ScalarFunc ("/", 2)
{
}

double Divide::eval (vector <SArray const *> const &args) const
{
  return *args[0]->value() / *args[1]->value();
}

bool Divide::checkParameterValue (vector <SArray const *> const &args) const
{
  if (*(args[1]->value ()) == 0)
    return false;
  else
    return true;
}


syntax highlighted by Code2HTML, v. 0.9.1