func AppendFloat64f(b []byte, f float64) []byte {
	u := math.Float64bits(f)
	neg := u>>(mantBits64+expBits64) != 0
	mant := u & (uint64(1)<<mantBits64 - 1)
	exp := (u >> mantBits64) & (uint64(1)<<expBits64 - 1)
	if exp == uint64(1)<<expBits64-1 || (exp == 0 && mant == 0) {
		return appendSpecialf(b, neg, exp == 0, mant == 0)
	}
	d, ok := float64ToDecimalExactInt(mant, exp)
	if !ok {
		d = float64ToDecimal(mant, exp)
	}
	return d.appendF(b, neg)
}
AppendFloat64 appends the string form of the 64-bit floating point number f,
as generated by FormatFloat64, to b and returns the extended buffer.
It behaves like strconv.AppendFloat(b, f, 'f', -1, 64).
package ryu
import (
	"math"
	"reflect"
	"unsafe"
)
const (
	mantBits32 = 23
	expBits32  = 8
	bias32     = 127
	mantBits64 = 52
	expBits64  = 11
	bias64     = 1023
)
func FormatFloat32(f float32) string {
	b := make([]byte, 0, 15)
	b = AppendFloat32(b, f)
	var s string
	sh := (*reflect.StringHeader)(unsafe.Pointer(&s))
	sh.Data = uintptr(unsafe.Pointer(&b[0]))
	sh.Len = len(b)
	return s
}
func AppendFloat32(b []byte, f float32) []byte {
	u := math.Float32bits(f)
	neg := u>>(mantBits32+expBits32) != 0
	mant := u & (uint32(1)<<mantBits32 - 1)
	exp := (u >> mantBits32) & (uint32(1)<<expBits32 - 1)
	if exp == uint32(1)<<expBits32-1 || (exp == 0 && mant == 0) {
		return appendSpecial(b, neg, exp == 0, mant == 0)
	}
	d, ok := float32ToDecimalExactInt(mant, exp)
	if !ok {
		d = float32ToDecimal(mant, exp)
	}
	return d.append(b, neg)
}
func FormatFloat64(f float64) string {
	b := make([]byte, 0, 24)
	b = AppendFloat64(b, f)
	return byteSliceToString(b)
}
func byteSliceToString(b []byte) string {
	return *(*string)(unsafe.Pointer(&b))
}
func AppendFloat64(b []byte, f float64) []byte {
	u := math.Float64bits(f)
	neg := u>>(mantBits64+expBits64) != 0
	mant := u & (uint64(1)<<mantBits64 - 1)
	exp := (u >> mantBits64) & (uint64(1)<<expBits64 - 1)
	if exp == uint64(1)<<expBits64-1 || (exp == 0 && mant == 0) {
		return appendSpecial(b, neg, exp == 0, mant == 0)
	}
	d, ok := float64ToDecimalExactInt(mant, exp)
	if !ok {
		d = float64ToDecimal(mant, exp)
	}
	return d.append(b, neg)
}
func appendSpecial(b []byte, neg, expZero, mantZero bool) []byte {
	if !mantZero {
		return append(b, "NaN"...)
	}
	if !expZero {
		if neg {
			return append(b, "-Inf"...)
		} else {
			return append(b, "+Inf"...)
		}
	}
	if neg {
		b = append(b, '-')
	}
	return append(b, "0e+00"...)
}
func FormatFloat64f(f float64) string {
	b := make([]byte, 0, 24)
	b = AppendFloat64f(b, f)
	return byteSliceToString(b)
}