public static int writeFloat(byte[] buf, int off, float floatValue, boolean json) {
        if (Float.isNaN(floatValue) || floatValue == Float.POSITIVE_INFINITY || floatValue == Float.NEGATIVE_INFINITY) {
            return writeSpecial(buf, off, floatValue, json);
        }
        int bits;
        if (floatValue == 0) {
            bits = Float.floatToIntBits(floatValue);
            if (bits == 0x80000000) {
                buf[off++] = '-';
            }
            buf[off] = '0';
            IOUtils.putShortUnaligned(buf, off + 1, DOT_ZERO_16);
            return off + 3;
        }
        boolean sign = floatValue < 0;
        if (sign) {
            buf[off++] = '-';
            floatValue = -floatValue;
        }

        Scientific scientific = floatToScientific(floatValue);
        return writeDecimal(scientific.output, scientific.count, scientific.e10, buf, off);
    }
Conversion of ieee floating point numbers to Scientific notation

<p> Using the difference estimation method </p>
<p> The output may not be the shortest, but the general result is correct </p>

@param doubleValue &gt; 0
core/src/main/java/com/alibaba/fastjson2/util/NumberUtils.java