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

Method negateNonNull

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

Negates this Decimal256 in-place using two's complement arithmetic. Changes the sign of the decimal number (positive becomes negative and vice versa).

()

Source from the content-addressed store, hash-verified

1443 * Changes the sign of the decimal number (positive becomes negative and vice versa).
1444 */
1445 public void negateNonNull() {
1446 ll = ~ll + 1;
1447 long c = ll == 0L ? 1L : 0L;
1448 lh = ~lh + c;
1449 c = (c == 1L && lh == 0L) ? 1L : 0L;
1450 hl = ~hl + c;
1451 c = (c == 1L && hl == 0L) ? 1L : 0L;
1452 hh = ~hh + c;
1453 }
1454
1455 /**
1456 * Sets this Decimal256 to the specified 256-bit value and scale.

Callers 3

negateMethod · 0.95
roundMethod · 0.95
rescale0Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected