Added functions for encoding and decoding floats