Package dev.gmitch215.bytebox.text
Class FloatAnalyzer
java.lang.Object
dev.gmitch215.bytebox.text.FloatAnalyzer
The class library's
FloatAnalyzer (TeaVM 0.15.0, org.teavm.classlib.impl.text),
with its digits worked out by Exact.
This is what Float.toString, String.valueOf(float) and string concatenation of a
float write digits from. The original multiplies by a 32-bit table entry, which leaves the value and
the two edges of the interval of decimals that read back as the same float a few units of the last
digit off, so some floats came out as text that is not the shortest, or does not read back as the
float. Here every float goes through the exact route DoubleAnalyzer falls back on: there are no
tables, so a program that prints floats gets smaller, and a call costs a microsecond or so.
Found through Substitutions. It replaces the class under its own name, so the
PRECISION and MAX_POS the string builder reads are kept.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
-
Field Details
-
PRECISION
public static final int PRECISION- See Also:
-
MAX_POS
public static final int MAX_POS- See Also:
-
-
Method Details
-
analyze
-