RE: [PHP] Doing simple math
| From: | John W. Holmes | Date: | Wed, 04 Jun 2003 02:58:41 +0000 |
| Subject: | RE: [PHP] Doing simple math | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-150098@lists.php.net to get a copy of this message | ||
> I'm having a problem I don't think I should be having. Basically, I'm
> doing some simple math, and I'm having issues in making PHP do it
(with
> the brackets in particular).
>
> An example that looks like it -should- work:
>
> $Math = sqrt(81)(5+4)-1;
Do you mean:
$Math = sqrt(81)*(5+4)-1;
You can't leave out the * for multiplication. y = mx + b in algebra must
be written as $y = $m * $x + $b, for example.
---John W. Holmes...
Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/