Doing simple math
| From: | Chris Cameron | Date: | Wed, 04 Jun 2003 02:49:18 +0000 |
| Subject: | Doing simple math | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-150097@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;
Well of course that doesn't work because of the (I believe) brackets.
I'm unable to think of any easy alternative that wouldn't make
reading/writing these things terribly messy/hard.
The above examples I just pulled out of the air, but I need to deal with
many groupings with brackets, various functions (pow() and sqrt()
mostly) and basic addition and subtraction, which adds a greater
complexity.
Have I missed something obvious? Or am I doomed to do a bunch of smaller
math things so that I can do these bigger ones?
Thanks,
Chris
--
Chris Cameron
UpNIX Internet Administrator
ardvark.upnix.net
bitbucket.upnix.net
--
http://www.upnix.com