msgpack-postgres
msgpack-postgres copied to clipboard
feat: implements encoding of floating point numbers as float64
I ported the the encoding of floats to float64 from https://github.com/feross/ieee754
This fails for negative doubles. Will fix that soon.
Hey, thanks for your contribution! I know it may sound weird, but may I ask you to avoid using helper functions and move everything into the msgpack_encode function? I don't like the idea of polluting the public namespace with helper functions when that's not necessary.
One more thing - can you please retain the old code formatting? Thanks!
I can reformat the code to use tabs instead of spaces.
Would you be more comfortable with helper functions that are all msgpack_* instead (eg. msgpack_array, msgpack_boolean, msgpack_float, msgpack_integer, msgpack_object, msgpack_text)? I could certainly inline the smaller helper functions (is_nan and is_negative_zero). float_to_bytea would be renamed to msgpack_float.
@patriksimek any thoughts on having msgpack* functions?
I don't see much value in splitting that into multiple functions. There's no code duplication and those helper functions itself have no value to anyone. That being said, I'd still prefer to have everything in one function. Thanks!