I have a complex expression I'm working with in Power Automate that has been causing some problems. I've narrowed the issue down to the part of the expression that uses the mod function. It produces the expected results if the dividend is not a negative number. When the dividend is a negative number, the result isn't as expected. For example, if in Power Automate I have this function
mod(sub(7,11),3) the result is -1. However, I would expect that the result should be 2. If I use an equivalent function in Excel =MOD((7-11),3) I get 2 as I would expect. Why should the result be different? In this example shouldn't the result from the Power Automate function be 2? Again, it seems this issue only occurs when the dividend is a negative number. Any help or thoughts on this would be much appreciated.