Re: Maths on variables - please help
| From: | Hugh Danaher | Date: | Tue, 11 Mar 2003 08:31:49 +0000 |
| Subject: | Re: Maths on variables - please help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-139101@lists.php.net to get a copy of this message | ||
simply:
$var1=99;
$var2=0;
$result=$var1*$var2; multiplication by zero is ok
if ($var2!=0) { //division by zero is bad "!=" means not equal
$result=$var1/$var2;
}
use brackets in complex equations
$result=$var1*(1+$var2);
hugh
----- Original Message -----
From: "Adriaan Nel" <adriaan@nellen.co.za>
To: <php-general@lists.php.net>
Sent: Monday, March 10, 2003 11:37 PM
Subject: [PHP] Maths on variables - please help
> Hi every1,
>
> I would like some help on multiplication/division of variables on 1
> another....I have looked at the bcmath() function, but it doesn't seem to
> work.
>
> Could any1 pls assist.
>
> Adriaan
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>