Encode and decode floating point numbers