Hello all,

I am making a modular ship creator for a game, and different components add/subtract to the speed and defense of the ship. I am currently working on the speed side and the equation is speed = t *= e += r+= ss /= b+= c; Every letter is a variable. When I click a button to update it, it just returns infinity, which A) I didn’t know was possible and B) not how fast it should go. Any other ideas? Here is the equation in normal math. Speed = ((t*e)+r+ss)/(b+c)

is b+c possibly zero? Divide by zero gives you infinity.

It is not, I set all the numbers to one, it can either update to 1.5 or 1 again.

Your math is wrong.

Evaluation goes from right to left, one variable at a time. You can’t chain those like that. Those formulas become different:

`a+=b/=c+=d`

is same as `a + b/(c+d)`

, which is different from `(a + b)/(c + d)`

.

Is there any way to run the equation like this with js?

Just write it out using parenthesis: `(a + b)/(c + d)`