For the following questions, I'll be using two distinct units called A and B… you can call them the unit meter and unit second, if you need them to be specific units.
Suppose I have A^3 % A^2. What is the result? It's 0, right? Because no matter what A is, A^3 / A^2 = A, and so the operation has been performed with no remainder. So it's 0.
What about A^2 / A^3, though? When you divide one by the other you end up with A^-1… does that have a remainder? No, so it's 0 again? I feel less confident here.
Suppose I have A % B. What is the result? Is there even any way this makes sense? (Note that A and B might be numbers, but they might not be. They might be the unit meter and the unit second.)
If there's some way that A % B makes sense, then will it expand to A^2 % B?
The application I'm working on is just a calculator application. It has the option of including units and the option of using a modulo operation, so I'd like to know what some good output would be if the user ever mixed the two together. If there's a logical answer, I'd like to give it, and if there isn't, I'll just present an error to the user.
Suppose I have A^3 % A^2. What is the result? It's 0, right? Because no matter what A is, A^3 / A^2 = A, and so the operation has been performed with no remainder. So it's 0.
What about A^2 / A^3, though? When you divide one by the other you end up with A^-1… does that have a remainder? No, so it's 0 again? I feel less confident here.
Suppose I have A % B. What is the result? Is there even any way this makes sense? (Note that A and B might be numbers, but they might not be. They might be the unit meter and the unit second.)
If there's some way that A % B makes sense, then will it expand to A^2 % B?
The application I'm working on is just a calculator application. It has the option of including units and the option of using a modulo operation, so I'd like to know what some good output would be if the user ever mixed the two together. If there's a logical answer, I'd like to give it, and if there isn't, I'll just present an error to the user.
Last edited: