D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21817 - std.format: %u on integer does not print unsigned value
Summary: std.format: %u on integer does not print unsigned value
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2021-04-10 17:34 UTC by Berni44
Modified: 2021-04-15 07:12 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Berni44 2021-04-10 17:34:18 UTC
unittest
{
    assert(format!"%u"(-5) == "4294967291");
}

The result is actually -5 which is not unsigned...
Comment 1 Dlang Bot 2021-04-13 20:05:04 UTC
@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 Dlang Bot 2021-04-15 07:12:17 UTC
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