00001 package com.graphbuilder.math.func; 00002 00006 public class LgFunction implements Function { 00007 00008 public LgFunction() {} 00009 00013 public double of(double[] d, int numParam) { 00014 return java.lang.Math.log(d[0]) / java.lang.Math.log(2); 00015 } 00016 00020 public boolean acceptNumParam(int numParam) { 00021 return numParam == 1; 00022 } 00023 00024 public String toString() { 00025 return "lg(x)"; 00026 } 00027 }