MCPcopy Create free account
hub / github.com/questdb/questdb / divide

Method divide

core/src/main/java/io/questdb/std/Decimal128.java:346–349  ·  view source on GitHub ↗

Divide two Decimal128 numbers and store the result in sink (a / b -> sink) Uses optimal precision calculation up to MAX_SCALE @param a First operand (dividend) @param b Second operand (divisor) @param sink Destination for the result @param scale Result scale @pa

(Decimal128 a, Decimal128 b, Decimal128 sink, int scale, RoundingMode roundingMode)

Source from the content-addressed store, hash-verified

344 * @param roundingMode Rounding Mode used to round the result
345 */
346 public static void divide(Decimal128 a, Decimal128 b, Decimal128 sink, int scale, RoundingMode roundingMode) {
347 sink.copyFrom(a);
348 sink.divide(b, scale, roundingMode);
349 }
350
351 /**
352 * Create a Decimal128 from a BigDecimal value.

Callers 15

testDivideMethod · 0.95
testDivide64Method · 0.95
testDivideLargeMethod · 0.95
testDivideLargeScaleMethod · 0.95
testDivideOverflowMethod · 0.95
testDivisionByOneMethod · 0.95
testDivisionByZeroMethod · 0.95
testDivisionDivWordMethod · 0.95

Calls 11

validateScaleMethod · 0.95
instanceMethod · 0.95
isNegativeMethod · 0.95
negateMethod · 0.95
ofDividendMethod · 0.80
ofDivisorMethod · 0.80
copyFromMethod · 0.65
putMethod · 0.65
clearMethod · 0.65
sinkMethod · 0.65

Tested by 15

testDivideMethod · 0.76
testDivide64Method · 0.76
testDivideLargeMethod · 0.76
testDivideLargeScaleMethod · 0.76
testDivideOverflowMethod · 0.76
testDivisionByOneMethod · 0.76
testDivisionByZeroMethod · 0.76
testDivisionDivWordMethod · 0.76