Skip to main content
gamedev.net
🔒 Locked

Basic Math Problem

Started by Souljah Oct 24, 2005 at 4:42 AM 0 replies 1k views
Original Post
Souljah
Souljah
Hi, I really need some help rearranging a formula to display the difference of a total. Basically, what the code will do is take the necessary amount off an entered Duration so that it does not exceed a credit amount in 'pence'. I seem to have made one (much simpler) of it work but this one is stomping me. Heres the simple one - Difference = (Duration * hRate) - CreditAvailable; Duration2 = Duration1 - (Difference/hRate); Duration1 = (int)Duration2; And heres the one I'm trying to solve - Difference= (Duration1 - 120) * lRate + (hRate * 120) - CreditAvailable; ---------------------------------Heres where I'm trying things out - making duration2 the subject. Duration1 = (int)Duration2;
Souljah
Souljah
Basically what the statement is supposed to do is adjust the Call Duration so that a call cant be made for longer than the credit available allows, based on a high rate for the first 2 mins (120 secs) and a low rate thereafter.

I just need some help sorting this equation to make this adjustment like the simpler one

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.