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

printf("%u", num) shows pointless ".." for negative num #3400

Closed
tsahara opened this issue Jan 16, 2017 · 0 comments
Closed

printf("%u", num) shows pointless ".." for negative num #3400

tsahara opened this issue Jan 16, 2017 · 0 comments

Comments

@tsahara
Copy link
Member

@tsahara tsahara commented Jan 16, 2017

printf family functions place ".." before the string representation of a negative value for non-decimal format specifiers:

% ruby -e 'printf "%x\n", -1'
..f

% mruby -e 'printf "%x\n", -1'
..f

But, for unsigned decimal format specifier %u, leading ".." is not expected and does not make sense:

% ruby -e 'printf "%u\n", -1'
-1

% mruby -e 'printf "%u\n", -1'
..-1
@matz matz closed this as completed in c830698 Jan 16, 2017
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

No branches or pull requests

1 participant