Implement (de)serialization of doubles