Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!ames!uhccux!bigtuna!pegasus!tleylan From: tleylan@pegasus.com (Tom Leylan) Newsgroups: comp.lang.c Subject: Re: Math Formulae Message-ID: <1991Jan2.015446.1406@pegasus.com> Date: 2 Jan 91 01:54:46 GMT References: <3066@lupine.NCD.COM> <1990Dec29.073901.1810@pegasus.com> <18444:Dec3104:13:5090@kramden.acf.nyu.edu> Organization: Pegasus, Honolulu Lines: 23 In article <18444:Dec3104:13:5090@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: > >cost = 0.03 * total; >if (total > 1000.00) > cost = 0.03 * 1000.00 + 0.02 * (total - 1000.00); >if (cost < 20.00) > cost = 20.00; > Dan, Thanks for "solution" I obviously didn't phrase my query correctly as it wasn't _that_ particular problem I was interested in solving it was the problem of solving whatever business formula was required. Some start with a base commission depending upon monthly sales with minimums and maximums and 10 companies can calculate it 10 different ways. I'm trying to avoid being a "formula maintainer" for the rest of my career. A few people have suggested that I write my own little math formula processor and that sound like the solution... a sort of SQL for math problems. I also accidentally (I stand behind the 5th amendment to the Constitution) posted my message as a follow-up to someone elses thread and while I'm sorry I did it it seems irreversible at this point. tom