improve decoding / encoding double and float