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

Method round

basex-core/src/main/java/org/basex/query/value/item/Flt.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 Flt round(final int prec, final RoundMode mode) {
100 if(value == 0 || Float.isNaN(value) || Float.isInfinite(value)) return this;
101 final float f = Dec.round(BigDecimal.valueOf(value), prec, mode).floatValue();
102 return f == 0 && Float.floatToRawIntBits(value) < 0 ? NEGATIVE_ZERO :
103 f == value ? this : Flt.get(f);
104 }
105
106 @Override
107 public int compare(final Item item, final Collation coll, final boolean transitive,

Callers

nothing calls this directly

Calls 3

roundMethod · 0.95
getMethod · 0.95
isNaNMethod · 0.80

Tested by

no test coverage detected