note 100948 added to language.functions
| From: | nassimrehali at osu1 dot php dot net | Date: | Tue, 16 Nov 2010 19:35:20 +0000 |
| Subject: | note 100948 added to language.functions | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-174095@lists.php.net to get a copy of this message | ||
This function calculates the delta of the quadratic equation, which gives you the solutions and the
solutions were not there you will print it
and these is the class coded by me : the algerian nassim rehali
<?
class delta_class {
public $a = '1';
public $b = '4';
public $c = '1';
function alger(){
// calculate delta
$bb = $this->b * $this->b;
$ab = 4*$this->a*$this->c;
// apercevoir delta
echo delta is : ";
echo $delta = $bb-$ab."<br>";
if($delta > 0){
// la racine de delta
$racine_delta = sqrt($delta);
// les deux solution
$x1 = -$this->b - $racine_delta / 2 * $this->a;
$x2 = -$this->b + $racine_delta / 2 * $this->a;
echo "the first solution is : ";
echo $x1;
echo "<br>";
echo "the second solution is: ";
echo $x2;
exit();
}elseif($delta == 0){
// la seule solution
$x3 = - $this->b / 2 * $this->a;
echo "the is only one solution :";
echo $x3;
return $x3;
}elseif($delta < 0){
// apercevoir qu'il existe pas de solution
echo"don't exist solution ";
exit();
}
}
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 80.239.242.95 (proxied: 41.105.50.123)
----
Manual Page -- http://www.php.net/manual/en/language.functions.php
Edit -- https://master.php.net/note/edit/100948
Del: integrated -- https://master.php.net/note/delete/100948/integrated
Del: useless -- https://master.php.net/note/delete/100948/useless
Del: bad code -- https://master.php.net/note/delete/100948/bad+code
Del: spam -- https://master.php.net/note/delete/100948/spam
Del: non-english -- https://master.php.net/note/delete/100948/non-english
Del: in docs -- https://master.php.net/note/delete/100948/in+docs
Del: other reasons-- https://master.php.net/note/delete/100948
Reject -- https://master.php.net/note/reject/100948
Search -- https://master.php.net/manage/user-notes.php