Page 1 of 1

Mathematical Equation

Posted: Sun Feb 29, 2004 11:13 am
by HaVoC
How would I do this? I kept getting parse errors. I tried this.

Code: Select all

<?php
($wins / $losses) * 100
?>

Posted: Sun Feb 29, 2004 11:23 am
by nigma
What is it that you want to do? Print out the solution?

If so, assuming that both $wins and $losses have been declared, and $losses is not zero than you can print the solution by doing:

Code: Select all

echo $wins / $losses * 100;

Posted: Sun Feb 29, 2004 11:35 am
by Dr Evil
You could try:

Code: Select all

<?php
if ($losses>'0'){
$result = $wins / $losses * 100;
}
else{
$result = "Can not be calculated!";
}

echo $result;

?>
If you are trying to get the percentage of losses, you have to take the total amount of games:

Code: Select all

<?php
if (($losses+$wins)>'0'){
$result = $wins / ($wins+$losses) * 100;
}
else{
$result = "Can not be calculated!";
}

echo $result;

?>

Posted: Sun Feb 29, 2004 4:39 pm
by nigma
Hey havoc, you make that signature up? Definitely something that people could spend many hours thinking about :)

Posted: Sun Feb 29, 2004 5:43 pm
by d3ad1ysp0rk
It's the same thing as "The above statement is true" and a few others

a real mind boggler tho :P

Posted: Sun Feb 29, 2004 6:53 pm
by HaVoC
The signature is a riddle. I haven't found the real answer for it. But I made up my own. It drove me insane. So the answer to the riddle in my opinion is insanity. Btw, Thanks a bunch Dr.Evil

Posted: Sun Feb 29, 2004 6:57 pm
by d3ad1ysp0rk
haha.. your sig reminds me of politicians..

which one to believe.. hmm..

Posted: Mon Mar 01, 2004 1:43 am
by toms100
hehe, the ultimate paradox, "this statement is false"

Posted: Mon Mar 01, 2004 6:43 pm
by nigma
It's not the wording of the statement but the message it conveys, whether it's "the statement below is true" or "the line below is true" is of no importance.

A real mind boggler :)