| 415 | // public float subtract(float a, float b) { return a - b; } |
| 416 | |
| 417 | public static Object divide(Object a, Object b) { |
| 418 | a = normalizeIntIfNeeded(a); |
| 419 | b = normalizeIntIfNeeded(b); |
| 420 | if (a == null || b == null) return null; |
| 421 | |
| 422 | if (a instanceof Long && b instanceof Long) { |
| 423 | return ((Long) a).doubleValue() / ((Long) b); // we want the reminder hence the cast |
| 424 | } else if (a instanceof Double && b instanceof Double) { |
| 425 | return ((Double) a) / ((Double) b); |
| 426 | } else { |
| 427 | return toDouble(a) / toDouble(b); |
| 428 | } |
| 429 | } |
| 430 | |
| 431 | public static Object multiply(Object a, Object b) { |
| 432 | a = normalizeIntIfNeeded(a); |