Subtracting Out The Sugar

Submitted By:
david

Difficulty:
Elementary

Tags:
arithmetic

Instructions:
Everyone knows that 2 + 2 = 4 but do you know how to add and subtract without the syntactical sugar that makes infix notation possible?

Code:
assert_equal 2.___(2), 2 + 2
assert_equal 40.___(2), 42

Your Solution

Ruby 1.9.3

Back to Problems