MCPcopy Create free account
hub / github.com/BaseXdb/basex / cmpNum

Method cmpNum

basex-core/src/main/java/org/basex/util/list/IntList.java:569–572  ·  view source on GitHub ↗

Compares two numeric tokens and returns an integer. @param value1 first value @param value2 second value @return result

(final byte[] value1, final byte[] value2)

Source from the content-addressed store, hash-verified

567 * @return result
568 */
569 private static int cmpNum(final byte[] value1, final byte[] value2) {
570 final double n = Token.toDouble(value1) - Token.toDouble(value2);
571 return n > 0 ? 1 : n < 0 ? -1 : 0;
572 }
573
574 /**
575 * Compares two tokens and returns an integer.

Callers 1

sortMethod · 0.95

Calls 1

toDoubleMethod · 0.95

Tested by

no test coverage detected