-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Addint support for complex type #2207
Comments
I'm hesitant, because this would define the serialization format for a standard type where there is not canonic serialization. You propose serializing as array, but an object would also make sense, e.g. {"complex": {"real": 1, "imag": 0}} Though the user could override the defaults, I am not sure whether the library should propose a default. Any opinions on this? |
Good point. It seems msgpack also doesn’t define a spec for complex numbers. Weird. As engineers we use them almost just as often as real numbers so why do these specs not care about complex numbers?? |
I guess if you start doing that, then people will want quaternions and other exotic things and then it quickly becomes a math serialisation library. |
The good thing is that you can realize the conversion with the few lines above, and I think this issue should pop up in any search for issues with the word "complex". |
As a json string i would expect to see something like
For example. But no other json library, including the built-in javascript JSON library, would understand that without adding custom parsers. We need to open an issue on the JSON spec if that exists. |
The JSON specification is unlikely to ever change. The RFC has been updated every once in a while, but never were new types added. |
Could we add official support for complex type. I don't know if this requires a fully blown PR as the code is so small:
The text was updated successfully, but these errors were encountered: