Bug 21776 – %b, %o, %x and %X on integers does not obey plus and space flag

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-03-28T08:45:23Z
Last change time
2021-04-10T06:12:37Z
Assigned to
No Owner
Creator
Berni44

Comments

Comment #0 by bugzilla — 2021-03-28T08:45:23Z
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"); }
Comment #1 by bugzilla — 2021-04-10T06:12:37Z
Meanwhile I think, this is intentional: These format characters give the image of the bit pattern, which means, there is no sign. So closing this as invalid.