Skip to content

Instantly share code, notes, and snippets.

@m2web
Created January 20, 2012 15:56
Show Gist options
  • Save m2web/1647989 to your computer and use it in GitHub Desktop.
Save m2web/1647989 to your computer and use it in GitHub Desktop.
-2*-2 = 2*2. In other words, when you multiply 2 negative integers it is the same as multiplying the same two positive integers. -x*-y = x*y.
#-2*-2 = 2*2. In other words, when you
#multiply 2 negative integers it is the
#same as multiplying the same two positive
#integers. -x*-y = x*y
x = 2
y = 3
puts ((x*y + x*-y) + -x*-y == x*y) ==
((x*y + x*-y) + -x*-y == -x*-y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment