(potentially) more portable implementation of double/float serialization for mono