@Test public void testInfinity() { assertEquals(Float.POSITIVE_INFINITY, mCalculator.makeCalculation(12f, 0f, Sign.DIVIDE), DELTA); }
public float makeCalculation(final float firstNumberFloat, final float secondNumberFloat, final String sign) { float result = 0f; switch (sign) { case Sign.PLUS: result = firstNumberFloat + secondNumberFloat; break; case Sign.MINUS: result = firstNumberFloat - secondNumberFloat; break; case Sign.MULTIPLY: result = firstNumberFloat * secondNumberFloat; break; case Sign.DIVIDE: result = firstNumberFloat / secondNumberFloat; break; } return result; }
Calculator { public float makeCalculation(final float firstNumberFloat, final float secondNumberFloat, final String sign) { float result = 0f; switch (sign) { case Sign.PLUS: result = firstNumberFloat + secondNumberFloat; break; case Sign.MINUS: result = firstNumberFloat - secondNumberFloat; break; case Sign.MULTIPLY: result = firstNumberFloat * secondNumberFloat; break; case Sign.DIVIDE: result = firstNumberFloat / secondNumberFloat; break; } return result; } }
Calculator { public float makeCalculation(final float firstNumberFloat, final float secondNumberFloat, final String sign) { float result = 0f; switch (sign) { case Sign.PLUS: result = firstNumberFloat + secondNumberFloat; break; case Sign.MINUS: result = firstNumberFloat - secondNumberFloat; break; case Sign.MULTIPLY: result = firstNumberFloat * secondNumberFloat; break; case Sign.DIVIDE: result = firstNumberFloat / secondNumberFloat; break; } return result; }  }
Calculator { public float makeCalculation(final float firstNumberFloat, final float secondNumberFloat, final String sign) { float result = 0f; switch (sign) { case Sign.PLUS: result = firstNumberFloat + secondNumberFloat; break; case Sign.MINUS: result = firstNumberFloat - secondNumberFloat; break; case Sign.MULTIPLY: result = firstNumberFloat * secondNumberFloat; break; case Sign.DIVIDE: result = firstNumberFloat / secondNumberFloat; break; } return result; }  float makeCalculation(final float firstNumberFloat, final float secondNumberFloat, final String sign); Observable<Float> calculate(final String firstNumber, final String secondNumber, final String sign); }
Calculator { public float makeCalculation(final float firstNumberFloat, final float secondNumberFloat, final String sign) { float result = 0f; switch (sign) { case Sign.PLUS: result = firstNumberFloat + secondNumberFloat; break; case Sign.MINUS: result = firstNumberFloat - secondNumberFloat; break; case Sign.MULTIPLY: result = firstNumberFloat * secondNumberFloat; break; case Sign.DIVIDE: result = firstNumberFloat / secondNumberFloat; break; } return result; }  float makeCalculation(final float firstNumberFloat, final float secondNumberFloat, final String sign); Observable<Float> calculate(final String firstNumber, final String secondNumber, final String sign);  }