(int a)
| 3 | public class Question { |
| 4 | /* Flip a positive sign to negative, or a negative sign to pos */ |
| 5 | public static int negate(int a) { |
| 6 | int neg = 0; |
| 7 | int d = a < 0 ? 1 : -1; |
| 8 | while (a != 0) { |
| 9 | neg += d; |
| 10 | a += d; |
| 11 | } |
| 12 | return neg; |
| 13 | } |
| 14 | |
| 15 | /* Subtract two numbers by negating b and adding them */ |
| 16 | public static int minus(int a, int b) { |