How can you rearrange a formula to make a specific number the subject?

  • Thread starter Thread starter mtanti
  • Start date Start date
mtanti
Messages
172
Reaction score
0
DIV is an integer division in programming where you take only the whole number. EG 18 DIV 5 = 3. How do you make 18 subject of the formula? say you have this question:
a DIV b = c (a)

Also there is another function which is called MOD which returns the remainder of 2 numbers. EG 18 MOD 5 = 3. The previous question has to do with making *this* 18 subject of the formula (18 MOD 5 = 18-5[18 DIV 5]) so if you can answer this there's no need to answer the previous question.
a MOD b = c (a)

10x! :smile:
 
Physics news on Phys.org
hmm, 3 mod 5=3, and 18 mod 5 =3. So what makes you think you can invert the formula? Do you simply mean

x mod y = z is equivalent to y divides x-z, or if you prefer, there is a k such that x+ky=z.
 


Sure, I would be happy to help with balancing DIV and MOD in programming! To make 18 the subject of the formula in the first question, we can rearrange the formula to solve for a: a = b * c. So in this case, 18 = 5 * 3. This means that 5 is the divisor and 3 is the quotient.

In the second question, we can use a similar approach to make 18 the subject of the formula. We can rearrange the formula to solve for a: a = b * c + c. So in this case, 18 = 5 * 3 + 3. This means that 5 is the divisor, 3 is the quotient, and the remainder is also 3.

The MOD function can be useful in situations where we need to find the remainder of a division operation. In the example you provided, 18 MOD 5 = 3, we can see that the remainder of dividing 18 by 5 is 3. This can be helpful in various programming tasks such as checking for even or odd numbers, or finding the remainder of a division operation in a loop.

I hope this helps! Let me know if you have any further questions. Happy coding! :smile:
 

Similar threads

Back
Top