-
winnerhere
- Master | Next Rank: 500 Posts
- Posts: 231
- Joined: Thu Apr 12, 2007 2:45 am
- Thanked: 5 times
- Followed by:1 members
I am little confused about substituting a negative number in a modulus function..Please tell me whats wrong in my approach
|X-Z| + |X|
Now if both X and Z are negative and Z < X ...How should I substitute the negative values for the X and Y
I do the following.
|-X - (-Z) | + |-X|
= |Z-X| + |X|
= Z- X +X (Taking away the modulus as the negative sign has already been assigned to the variables)
= Z
But actually the answer should be -Z ... Please let me know the right approach
Thanks,
Sai
|X-Z| + |X|
Now if both X and Z are negative and Z < X ...How should I substitute the negative values for the X and Y
I do the following.
|-X - (-Z) | + |-X|
= |Z-X| + |X|
= Z- X +X (Taking away the modulus as the negative sign has already been assigned to the variables)
= Z
But actually the answer should be -Z ... Please let me know the right approach
Thanks,
Sai

















