Skip to content

Instantly share code, notes, and snippets.

@evaldosantos
Created August 20, 2015 13:22
Show Gist options
  • Save evaldosantos/b9fc94a05e9f0de31211 to your computer and use it in GitHub Desktop.
Save evaldosantos/b9fc94a05e9f0de31211 to your computer and use it in GitHub Desktop.
var add = function(x, y) { return x + y };
var multiply = function(x, y) { return x * y };
// associative
add(add(x, y), z) == add(x, add(y, z));
// commutative
add(x, y) == add(y, x);
// identity
add(x, 0) == x;
// distributive
multiply(x, add(y,z)) == add(multiply(x, y), multiply(x, z));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment