#include "ZGo.h"



//---- ZGoRandom

ZGoRandom::ZGoRandom(ZGo *zgo, ZGoPARAMS *input, ZGoPARAMS *output)
{
  this->zgo = zgo;
  this->input = input->setInput(this);
  this->output = output->setOutput(this);

  this->fnType = new ZGoNAME(zgo, "ZGoSine");

  //  Parameters

  min = (ZGoREAL *)input->get("min");
  max = (ZGoREAL *)input->get("max");
  result = (ZGoREAL *)output->get("result");
}

void ZGoRandom::process()
{
  min->process();
  max->process();

  result->value = min->value + (max->value - min->value) * (rand()&65535) * (1.0/65536.0);
}
