Bug 21817 – std.format: %u on integer does not print unsigned value

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-04-10T17:34:18Z
Last change time
2021-04-15T07:12:17Z
Keywords
pull
Assigned to
No Owner
Creator
Berni44

Comments

Comment #0 by bugzilla — 2021-04-10T17:34:18Z
unittest { assert(format!"%u"(-5) == "4294967291"); } The result is actually -5 which is not unsigned...
Comment #1 by dlang-bot — 2021-04-13T20:05:04Z
@berni44 created dlang/phobos pull request #7965 "std.format: New version for formatting integral values using writeAligned" fixing this issue: - Fix Issue 21817 - std.format: %u on integer does not print unsigned value https://github.com/dlang/phobos/pull/7965
Comment #2 by dlang-bot — 2021-04-15T07:12:17Z
dlang/phobos pull request #7965 "std.format: New version for formatting integral values using writeAligned" was merged into master: - 9e7ada3789ea1f29ea459d9201198e3310a127f3 by berni44: Fix Issue 21817 - std.format: %u on integer does not print unsigned value https://github.com/dlang/phobos/pull/7965