Basic math - the negative of any number is that same number but on the opposite side of zero. A negative of 2 is -2. A negative of -2 is 2 again.


In your x=-1 then put -(-x), the answer is correctly -1.

The two negatives basically cancel each other out. X was -1. -x flips it to 1. -(-x) flips it back to -1.

- Tab



At 07:46 AM 3/22/04, Peter Bochan wrote:
Hello,

In the Message Window:

x = -1
y = 1
put x,y
-- -1 1

put -x
-- 1 -- if I'm right, when two minuses collide, do they produce a plus?
put -y
-- -1

put -(-x)
-- -1 -- if I get it right, the result is -1 because initially x is -1. So,
in brackets we assign it to minus again, and it becomes a plus, but outside
the brackets it is assigned to minus again. So my question is: how come? How
come two minuses produce a plus? Or do I have to go to infants' school
again?
put -(-y)
-- 1 -- same here. The initial value of y is +1. In the brackets it is
assigned to minus, but outside the brackets two minuses collide and produce
a plus again.

TIA
peb965

[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]

Reply via email to