[Issue 21776] New: %b, %o, %x and %X on integers does not obey plus and space flag
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Mar 28 08:45:23 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=21776
Issue ID: 21776
Summary: %b, %o, %x and %X on integers does not obey plus and
space flag
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: bugzilla at bernis-buecher.de
All asserts fail, while with %d they work.
unittest
{
assert(format!"%+b"(15) == "+1111");
assert(format!"%+o"(15) == "+17");
assert(format!"%+x"(15) == "+f");
assert(format!"%+X"(15) == "+F");
assert(format!"% b"(15) == " 1111");
assert(format!"% o"(15) == " 17");
assert(format!"% x"(15) == " f");
assert(format!"% X"(15) == " F");
}
--
More information about the Digitalmars-d-bugs
mailing list