mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
In Ruby, sprintf specifier %u should behave as %d; fix #3730
Since there's no unsigned integer in Ruby. Binary, octal and hexadecimal negative numbers can be represented by using 2's compliment. But decimal (not being power of 2) cannot be use that kind of format.
This commit is contained in:
@@ -838,10 +838,10 @@ retry:
|
||||
case 'b':
|
||||
case 'B':
|
||||
base = 2; break;
|
||||
case 'u':
|
||||
case 'd':
|
||||
case 'i':
|
||||
sign = 1;
|
||||
case 'u':
|
||||
default:
|
||||
base = 10; break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user