I am having a problem trying to solve an equation in programming.
Imagine I have this line of code:
Math.round(((x / 5) + Math.pow(x / 25, 1.3)) / 10) * 10;
Given x = 1000, the result is 320.
Now, how can I solve this equation given a result?
Imagine given the result 320 I want to get the minimum integer value of x that resolves that line of code.
/*320 =*/ Math.round(((x / 5) + Math.pow(x / 25, 1.3)) / 10) * 10;
I am having some hard time because of the Math.Round. Even thought that expression is a linear equation, the Math.Round makes way more solutions than one for x, so I want the minimum integer value for my solution.
Note that x is a integer and if I set x = 999 the result is still 320.
If I keep lowering x I can see that 984 (atleast in Chrome 64.0.3282.186) is the correct answer in this case, because is the lowest value of x equals to 320 in that expression/programming line.