MCPcopy
hub / github.com/ccxt/ccxt / multiply

Method multiply

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

Source from the content-addressed store, hash-verified

429 }
430
431 public static Object multiply(Object a, Object b) {
432 a = normalizeIntIfNeeded(a);
433 b = normalizeIntIfNeeded(b);
434 if (a == null || b == null) return null;
435
436 if (a instanceof Long && b instanceof Long) {
437 return ((Long) a) * ((Long) b);
438 }
439 double res = toDouble(a) * toDouble(b);
440 if (IsInteger(res)) {
441 return (long) res;
442 } else {
443 return res;
444 }
445 }
446
447 public static int getArrayLength(Object value) {
448 if (value == null) return 0;

Callers 15

buildOHLCVCMethod · 0.95
parsePrecisionMethod · 0.95
handleUntilOptionMethod · 0.95
describeMethod · 0.95
withdrawMethod · 0.95
signMethod · 0.95
fetchOHLCVMethod · 0.95
signOrderRequestMethod · 0.95
parseCurrencyMethod · 0.95

Calls 3

normalizeIntIfNeededMethod · 0.95
toDoubleMethod · 0.95
IsIntegerMethod · 0.95

Tested by 12

multiplyMethod · 0.76
testFetchOHLCVMethod · 0.76
testFetchCurrenciesMethod · 0.76
fetchOrderMethod · 0.76
testSafeMethod · 0.76
testProxiesMethod · 0.76
testWatchOHLCVMethod · 0.76