• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

very simple math question

coder1

Senior member
In math when you see an operation that like |10-15|-|20-40|
Do you treat the vertical lines like parenthesis? Does it follow the same order of operations. If so then this should equate to -15. Am I correct in understanding this?
 
Originally posted by: coder1
In math when you see an operation that like |10-15|-|20-40|
Do you treat the vertical lines like parenthesis? Does it follow the same order of operations. If so then this should equate to -15. Am I correct in understanding this?



absolute value..take whatever is in it first.

so

|10-15|-|20-40|
|-5| - |-20|
5 - 20
-15
 
they're absolute values and they are not quite the same as parentheses. For example, if you have

(12 - 10) + (4 - 5) then that is the same as 12 + (-10 +4 ) - 5 = 1
whereas |12 - 10| + |4 - 5| is not 12 + |-10 + 4| - 5

since |12 - 10| + |4 - 5| = |2| + |-1| = 2 + 1 = 3
and 12 + |-10 + 4| - 5 = 12 + |-6| - 5 = 12 + 6 - 5 = 13

I hope that helps 🙂

Oh FYI, |-x| = |x| = x for any positive real number x
 
Back
Top