Skip to content

Instantly share code, notes, and snippets.

@hornd
Created February 15, 2013 23:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hornd/4964421 to your computer and use it in GitHub Desktop.
Save hornd/4964421 to your computer and use it in GitHub Desktop.
Given an integer M and an integer N, return the result of summing integer N with integer M
/**
* @author hornd
*/
public class IntegerAdder extends IntegerArithmetic {
public IntegerAdder() {
super();
}
/* (non-Javadoc)
* @see com.hellayolo.math.IntegerArithmetic#GetResult(int, int)
*/
@Override
public int GetResult(int N, int M) {
return N - ~M - 1;
}
/* (non-Javadoc)
* @see com.hellayolo.math.IntegerArithmetic#getType()
*/
@Override
public EIntegerMathType getType() {
return EIntegerMathType.SUM;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment