
package pkg.xfl.unary;

import xfuzzy.lang.*;

public class square extends Unary {
 public square() {
   super("xfl","square");
   Parameter single[] = new Parameter[0];
   setSingleParameters(single);
  }

 public double compute(double a) {
 return a*a; 
  }

 public double derivative(double a) {
   double deriv;
 deriv = 2*a; 
   return deriv;
  }

 public boolean test () {
   return true;
  }

 public String getJavaCode() {
   String eol = System.getProperty("line.separator", "\n");
   String code = "";
   code += "    return a*a; "+eol;
   return code;
  }

 public String getCCode() {
   String eol = System.getProperty("line.separator", "\n");
   String code = "";
   code += "    return a*a; "+eol;
   return code;
  }

 public String getCppCode() {
   String eol = System.getProperty("line.separator", "\n");
   String code = "";
   code += "    return a*a; "+eol;
   return code;
  }
}
