I'm a very simple person with basic math knowledge. Recently I run into huge problems when calculating how much I spent.

Sometimes to calculate how much I spent I do a calculation $final sum - start sum$. However at other times I do $start sum - final sum$.

When I take the absolute values, are these two values guaranteed to be equal? I've noticed sometimes when I do it one way, or the other way, I get different numbers. Is it because I made a mistake entering the numbers or it's not guaranteed that absolute values are equal?

Somehow I can't reproduce this error today but I just ran into it yesterday. When I did $start sum - final sum$ I got value $y$, but when I did $final sum - start sum$ I got value $z$. I forgot to write down the numbers.

  • $\begingroup$ |x|=|-x|. so you must hv done some mistake $\endgroup$ – voldemort Jan 22 '15 at 18:37
  • $\begingroup$ Thanks @voldemort. I've been actually running into this issue for the last few years. I'll try to write numbers down. Somehow when doing money calculations I think there is value $x$ for which this isn't true (because of cents I think). I'll try to get exact dollar and cent values next time. $\endgroup$ – bodacydo Jan 22 '15 at 18:39

The best way to answer this might be to pick two arbitrary values for your starting sum and your final sum.

So, let $X=startsum$ and $Y=finalsum$

Now, let $x$=100 and $y$=175

$$x-y=-75$$ $$y-x=75$$ $$|-75|=75$$

So you see, any discrepancy between the absolute values of x-y and y-x must be some input error on your part.

  • $\begingroup$ Thanks. Does this work also if there are cents in the values? $\endgroup$ – bodacydo Jan 23 '15 at 7:35
  • $\begingroup$ I don't think it works if there are cents. $\endgroup$ – bodacydo Mar 7 '15 at 13:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.