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

Method rescale0

core/src/main/java/io/questdb/std/Decimal256.java:2889–2905  ·  view source on GitHub ↗

Rescale this Decimal256 in place without checks @param newScale The new scale (must be >= current scale)

(int newScale)

Source from the content-addressed store, hash-verified

2887 * @param newScale The new scale (must be >= current scale)
2888 */
2889 private void rescale0(int newScale) {
2890 int scaleDiff = newScale - this.scale;
2891
2892 boolean isNegative = isNegative();
2893 if (isNegative) {
2894 negateNonNull();
2895 }
2896
2897 // Multiply by 10^scaleDiff
2898 multiplyByPowerOf10InPlace(scaleDiff);
2899
2900 if (isNegative) {
2901 negateNonNull();
2902 }
2903
2904 this.scale = newScale;
2905 }
2906
2907 /**
2908 * Set this Decimal256 from a byte array representation.

Callers 3

moduloMethod · 0.95
rescaleMethod · 0.95
addMethod · 0.45

Calls 3

isNegativeMethod · 0.95
negateNonNullMethod · 0.95

Tested by

no test coverage detected