On Sun, 2002-02-10 at 11:05, Gary wrote: > Hi All, > This is the first time I have had to deal with math. I have gone > through the manual and a few books and I think I am worse off then when > I started. Can someone give me an example of the simple math below. I > think If I see some in code I can move on from there. > > I need to find out if $pa > $pb or $pb > $pa then subtract smallest from > the largest and add $ca and then add $ps > > TIA > Gary
Break the problem down: I need to subtract the lesser (minimum) of $pa and $pb from the greater (maximum) of $pa and $pb; Then just add $ca and $ps. So something like this will do it: $result = (max($pa, $pb) - min($pa, $pb)) + $ca + $ps; Hope this helps, Torben -- Torben Wilson <[EMAIL PROTECTED]> http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

