-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Bug: Incorrect encoding of complex numbers #995
Labels
Comments
Thanks for reporting @hemantjadon. This appears to be a legitimate bug. (Internal issue: GO-857) |
hemantjadon
added a commit
to hemantjadon/zap
that referenced
this issue
Sep 8, 2021
abhinav
pushed a commit
that referenced
this issue
Sep 8, 2021
Fix encoding of complex numbers with negative imaginary components. Previously, `2 - 3i` was encoded as the following: 2+-3i Instead of the following: 2-3i Fix this by handling negative imaginary components correctly. Fixes #995
abhinav
added a commit
that referenced
this issue
Sep 10, 2021
Per #1010, #1002, and #995, some of the corner cases where precision is changed or lost aren't fully tested. Add test cases for corner cases for a number of these: - complex{64, 128}: Test incorrect precision and negatives - float{32, 64}: Test incorrect precision - int{8, 16, 32, 64}: Test minimum and maximum values - uint{8, 16, 32, 64}: Test maximum values Per #1010, the test for complex64 incorrect precision is currently failing.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
zap.Complex128
andzap.Complex64
field types incorrectly formats complex numbers with negative imaginary component. Extra+
sign is added before the actual-
signEg.
2-3i
is formatted as2+-3i
Got output
Expected output
Reference
https://play.golang.org/p/xz9b8kz_hCR
The text was updated successfully, but these errors were encountered: