$fp=fopen($archivo,"a+"); fclose($fp); chmod($archivo,0777); } $fp=fopen($archivo,"a+"); fwrite( $fp,"\n".$ref ); fclose($fp); } } */ $largo = 300; if (isset($_GET['l'])) { $lg = intval($_GET['l']); if (my_is_integer($lg)) { if ($lg > 100 && $lg < 9999) { $largo = $lg; } else { $largo = 100; } } } $tamano = "f2"; if (isset($_GET['t'])) { $tm = $_GET['t']; if ($tm == "f1" || $tm == "f2" || $tm == "f3") { $tamano = $tm; } } $color = "blanco";
function pow($x) { if ($this->has_variables()) { $coeff_sum = $x->coeff_sum(); if ($x->has_variables() || !my_is_integer($coeff_sum)) { throw new EvaluatorException("exponent must be an integer if the base contains variables"); } if (pow(count($this->terms), $coeff_sum) > 100) { throw new EvaluatorException("will be too many terms"); } $p = $this->add(new Polynom(array())); for (; $coeff_sum - 1 > 0; $coeff_sum--) { $p = $p->mul($this); } } else { if ($x->has_variables()) { throw new EvaluatorException("exponent can not contain variables"); } else { $p = new Polynom(array(new Term(pow($this->coeff_sum(), $x->coeff_sum()), array()))); } } if (strlen($p->tostring()) > 200) { throw new EvaluatorException("the answer was too long"); } return $p; }