Use inject in the calc method

To avoid extra conditions.

Add test to the calc with no operations too.
Merge pull request #1 from MarceloCajueiro/calc-refactoring

Use inject in the calc method