1 function PHP_getSolutionOVQE($a,$b,$c=0){ 2 $x1=0; 3 $x2=0; 4 $detal=0; 5 if($a==0 && $b==0){ 6 return false; 7 } 8 if($a==0){ 9 $x1 = -1 * ($c/$b); 10 return [$x1]; 11 } 12 $detal = pow($b,2) - 4*$a*$c; 13 if($detal == 0){ 14 $x1 = (-1*$b + sqrt($detal)) / (2 * $a); 15 return [$x1]; 16 }else if($detal > 0){ 17 $x1 = (-1*$b + sqrt($detal)) / (2 * $a); 18 $x2 = (-1*$b - sqrt($detal)) / (2 * $a); 19 return [$x1,$x2]; 20 } 21 return false; 22 }
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。