Skip to content
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

Add printf %i, %a, %A; Fix %o, %x, %X (they should be unsigned) #240

Merged
merged 6 commits into from
Sep 14, 2024

Conversation

benhoyt
Copy link
Owner

@benhoyt benhoyt commented Sep 14, 2024

Fixes #229

See golang/go#52943

Go Spec says "In all non-constant conversions involving floating-point
or complex values, if the result type cannot represent the value the
conversion succeeds but the result value is implementation-dependent."

On x64 this does uint64(int64(f)), but on ARM it yields 0. The former
behaviour seems more intuitive, so run with that.
@benhoyt benhoyt merged commit 6e1b1b4 into master Sep 14, 2024
11 checks passed
@benhoyt benhoyt deleted the fix-printf-number-types branch September 14, 2024 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for %i in format strings.
1 participant