Papabjoe Posted November 20, 2005 Posted November 20, 2005 I need some help with a particular calcuation. I'm designing a solution to monitor weight training progress in the gym. Each exercise has a particular routine that requires an increase in weight/resistance after a particular objective is met. When you achieve a certain number of repetitions for a given exercise, you are supposed to increase the weight by approximately 2%. The problem is that the smallest increment of weight that can be increased in the gym is 5 lbs (2.5 lbs for each side of a barbell for example). I need a calcuation that will look at the current weight for an exercise and then increase it by 2% and then determin if it needs to be increased any further to accomodate the minimum unit of weight at the gym. Here is an example. Let's say that I am bench pressing 185 lbs. When I reach a particular objective I will need to increase the weight by 2%. In this case that means I will increase the resistance by 3.7 lbs. The problem is that the lightest unit that can be used is 2.5 lbs. In order to increase the weight by the smallest amount, I would have to add a 2.5 lb plate to each side of the barbell giving me a weight increase of 5 lbs instead of 3.7. I need the calc to determin the 2% increase and then determine if it can be divided by the lightest weight increase available and remain a whole number. If it fails that test it should increase the weight by the lightest amount possible - in this case 5 lbs. I hope I havent lost you with this explanation as I have already lost myself several times. Any help is greatly appreciated.
RalphL Posted November 20, 2005 Posted November 20, 2005 Take a look at the Div function. It is an integar divison so it will return whole numbers.
LaRetta Posted November 20, 2005 Posted November 20, 2005 Hi papabjoe, This calculation (result is number) will work for you: Ceiling ( weightField * 1.02 / 5 ) * 5 This will always round up to the nearest 5. It also works on negative numbers (if you need to decrease the weights). LaRetta
Recommended Posts
This topic is 7291 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now