MCPcopy
hub / github.com/ccxt/ccxt / subtract

Method subtract

java/lib/src/main/java/io/github/ccxt/Helpers.java:398–411  ·  view source on GitHub ↗
(Object a, Object b)

Source from the content-addressed store, hash-verified

396// }
397
398 public static Object subtract(Object a, Object b) {
399 a = normalizeIntIfNeeded(a);
400 b = normalizeIntIfNeeded(b);
401
402 if (a instanceof Long && b instanceof Long) {
403 return ((Long) a) - ((Long) b);
404 } else if (a instanceof Integer && b instanceof Integer) {
405 return ((Integer) a) - ((Integer) b);
406 } else if (a instanceof Double || b instanceof Double) {
407 return toDouble(a) - toDouble(b);
408 } else {
409 return null;
410 }
411 }
412
413 // public static int subtract(int a, int b) { return a - b; }
414

Callers 15

filterByLimitMethod · 0.95
findNearestCeilingMethod · 0.95
buildOHLCVCMethod · 0.95
parsePrecisionMethod · 0.95
loadTimeDifferenceMethod · 0.95
fetchOHLCVMethod · 0.95
fetchMyTradesMethod · 0.95
fetchFundingHistoryMethod · 0.95

Calls 2

normalizeIntIfNeededMethod · 0.95
toDoubleMethod · 0.95

Tested by 10

subtractMethod · 0.76
testFetchOHLCVMethod · 0.76
AssertTimestampOrderMethod · 0.76
fetchOrderMethod · 0.76
addPaddingMethod · 0.76
testSafeMethod · 0.76
testWatchOHLCVMethod · 0.76
testSleepMethod · 0.76