package encoding
import (
)
func ( []byte, float64, int) []byte {
if math.IsInf(, 0) || math.IsNaN() {
panic(fmt.Sprintf("invalid float value: %s", strconv.FormatFloat(, 'g', -1, )))
}
:= math.Abs()
:= byte('f')
if != 0 {
if == 64 && ( < 1e-6 || >= 1e21) || == 32 && (float32() < 1e-6 || float32() >= 1e21) {
= 'e'
}
}
= strconv.AppendFloat(, , , -1, )
if == 'e' {
:= len()
if >= 4 && [-4] == 'e' && [-3] == '-' && [-2] == '0' {
[-2] = [-1]
= [:-1]
}
}
return
}