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

Method round

basex-core/src/main/java/org/basex/query/value/item/Dbl.java:98–104  ·  view source on GitHub ↗
(final int prec, final RoundMode mode)

Source from the content-addressed store, hash-verified

96 }
97
98 @Override
99 public Dbl round(final int prec, final RoundMode mode) {
100 if(value == 0 || !Double.isFinite(value)) return this;
101 final double d = Dec.round(new BigDecimal(value), prec, mode).doubleValue();
102 return d == 0 && Double.doubleToRawLongBits(value) < 0 ? NEGATIVE_ZERO :
103 d == value ? this : Dbl.get(d);
104 }
105
106 @Override
107 public int compare(final Item item, final Collation coll, final boolean transitive,

Callers

nothing calls this directly

Calls 2

roundMethod · 0.95
getMethod · 0.95

Tested by

no test coverage detected