Bug 5602 – BigInts ignore leading spaces as in "%5d"

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2011-02-16T16:21:00Z
Last change time
2011-09-08T13:43:51Z
Keywords
patch, wrong-code
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2011-02-16T16:21:58Z
import std.stdio, std.bigint; void main() { writefln("%10d", BigInt(10)); writefln("%10d", 10); } It prints: 10 10
Comment #1 by clugdbug — 2011-02-16T22:38:29Z
Yes, that's a limitation of std.format. It only provides the character ('x', 'd', 's', etc). The same thing applies to std.complex.
Comment #2 by bearophile_hugs — 2011-02-17T01:58:36Z
(In reply to comment #1) > Yes, that's a limitation of std.format. If that's a limitation meant to stay, then writef is better to give a format error (possibly at compile-time!).
Comment #3 by clugdbug — 2011-02-17T04:29:48Z
(In reply to comment #2) > (In reply to comment #1) > > Yes, that's a limitation of std.format. > > If that's a limitation meant to stay, then writef is better to give a format > error (possibly at compile-time!). Of course it's not meant to stay.
Comment #4 by k.hara.pg — 2011-09-02T09:39:31Z
Comment #5 by bearophile_hugs — 2011-09-08T13:43:51Z
Fixed in DMD 2.055