github.com/webmafia/fast@v0.10.0/binary/stream_write_float.go (about) 1 // Borrowed from jsoniter (https://github.com/json-iterator/go) 2 package binary 3 4 import ( 5 "math" 6 ) 7 8 // Write float32 9 func (b *StreamWriter) WriteFloat32(v float32) error { 10 return b.WriteUint32(math.Float32bits(v)) 11 } 12 13 // Write float64 14 func (b *StreamWriter) WriteFloat64(v float64) error { 15 return b.WriteUint64(math.Float64bits(v)) 16 }