Is odd, Coin change, long division
public static boolean isOdd(int i) {
// return i % 2 == 1; // WRONG
return i % 2 != 0;
// return (i & 1) != 0; // Quick way
}
//import java.math.BigDecimal;
public static void changeWord() {
System.out.println(2.00 - 1.10); // wrong
System.out.printf("%.2f%n", 2.00 - 1.10); // poor solution
System.out.println(new BigDecimal("2.00").subtract(new BigDecimal("1.10")));
}
public static void longDivision() {
final long MICROS_PER_DAY = 24 * 60 * 60 * 1000 * 1000; // Add 24L
final long MILLIS_PER_DAY = 24 * 60 * 60 * 1000;
System.out.println(MICROS_PER_DAY / MILLIS_PER_DAY);
}