/** * Created by dan on 6/14/17. */ public class MathUtilities { /** * @param baseValue starting value * @param difference value to add to starting value * @return sum of `baseValue` and `difference` */ public Integer add(int baseValue, int difference) { int solution = baseValue + difference; return solution; } /** * @param baseValue starting value * @param difference value to add to starting value * @return sum of `baseValue` and `difference` */ public Long add(long baseValue, long difference) { long solution = baseValue + difference; return solution; } /** * @param baseValue starting value * @param difference value to add to starting value * @return sum of `baseValue` and `difference` */ public Short add(short baseValue, short difference) { short solution = (short) (baseValue + difference); return solution; } /** * @param baseValue starting value * @param difference value to add to starting value * @return sum of `baseValue` and `difference` */ public Byte add(byte baseValue, byte difference) { int first = baseValue + difference; byte solution = (byte)first; return solution; } /** * @param baseValue starting value * @param difference value to add to starting value * @return sum of `baseValue` and `difference` */ public Float add(float baseValue, float difference) { float solution = baseValue + difference; return solution; } /** * @param baseValue starting value * @param difference value to add to starting value * @return sum of `baseValue` and `difference` */ public Double add(double baseValue, double difference) { double solution = baseValue + difference; return solution; } /** * @param baseValue starting value * @param difference value to subtract from starting value * @return difference between `baseValue` and `difference` */ public Integer subtract(int baseValue, int difference) { int solution = baseValue - difference; return solution; } /** * @param baseValue starting value * @param difference value to subtract from starting value * @return difference between `baseValue` and `difference` */ public Long subtract(long baseValue, long difference) { long solution = baseValue - difference; return solution; } /** * @param baseValue starting value * @param difference value to subtract from starting value * @return difference between `baseValue` and `difference` */ public Short subtract(short baseValue, short difference) { int convert = (short) baseValue - difference; short solution = (short) convert; return solution; } /** * @param baseValue starting value * @param difference value to subtract from starting value * @return difference between `baseValue` and `difference` */ public Byte subtract(byte baseValue, byte difference) { int conversion = baseValue - difference; byte solution = (byte) conversion; return solution; } /** * @param baseValue starting value * @param difference value to subtract from starting value * @return difference between `baseValue` and `difference` */ public Float subtract(float baseValue, float difference) { float solution = baseValue - difference; return solution; } /** * @param baseValue starting value * @param difference value to subtract from starting value * @return difference between `baseValue` and `difference` */ public Double subtract(double baseValue, double difference) { double solution = baseValue - difference; return solution; } /** * @param dividend value to be divided * @param divisor value to divide by * @return division of `dividend` by `divisor */ public Integer divide(int dividend, int divisor) { int division = dividend / divisor; return division; } /** * @param dividend value to be divided * @param divisor value to divide by * @return division of `dividend` by `divisor */ public Long divide(long dividend, long divisor) { long division = dividend / divisor; return division; } /** * @param dividend value to be divided * @param divisor value to divide by * @return division of `dividend` by `divisor */ public Short divide(short dividend, short divisor) { int convert = dividend / divisor; short solution = (short) convert; return solution; } /** * @param dividend value to be divided * @param divisor value to divide by * @return division of `dividend` by `divisor */ public Byte divide(byte dividend, byte divisor) { int convert = dividend / divisor; byte solution = (byte) convert; return solution; } /** * @param dividend value to be divided * @param divisor value to divide by * @return division of `dividend` by `divisor */ public Float divide(float dividend, float divisor) { float solution = dividend / divisor; return solution; } /** * @param dividend value to be divided * @param divisor value to divide by * @return division of `dividend` by `divisor */ public Double divide(double dividend, double divisor) { double solution = dividend / divisor; return solution; } /** * @param multiplicand value to be multiplied * @param multiplier value to multiply by * @return product of `multiplicand` by `multiplier` */ public Integer multiply(int multiplicand, int multiplier) { int solution = multiplicand * multiplier; return solution; } /** * @param multiplicand value to be multiplied * @param multiplier value to multiply by * @return product of `multiplicand` by `multiplier` */ public Long multiply(long multiplicand, long multiplier) { long solution = multiplicand * multiplier; return solution; } /** * @param multiplicand value to be multiplied * @param multiplier value to multiply by * @return product of `multiplicand` by `multiplier` */ public Short multiply(short multiplicand, short multiplier) { int convert = multiplicand * multiplier; short solution = (short) convert; return solution; } /** * @param multiplicand value to be multiplied * @param multiplier value to multiply by * @return product of `multiplicand` by `multiplier` */ public Byte multiply(byte multiplicand, byte multiplier) { int convert = multiplicand * multiplier; byte solution = (byte) convert; return solution; } /** * @param multiplicand value to be multiplied * @param multiplier value to multiply by * @return product of `multiplicand` by `multiplier` */ public Float multiply(float multiplicand, float multiplier) { float solution = multiplicand * multiplier; return solution; } /** * @param multiplicand value to be multiplied * @param multiplier value to multiply by * @return product of `multiplicand` by `multiplier` */ public Double multiply(double multiplicand, double multiplier) { double solution = multiplicand * multiplier; return solution; } /** * @return true */ public Boolean returnTrue() { boolean solution = true; return solution; } /** * @return false */ public Boolean returnFalse() { boolean solution = false; return solution; } }