--- wtext(int.max); --- core.exception.RangeError@std.conv(2526): Range violation Unittests in std.conv don't test wstring and big numbers.
Also I think, it's an overkill to fine tune allocation as it's done in to!string(uint)
(In reply to comment #1) > Also I think, it's an overkill to fine tune allocation as it's done in > to!string(uint) BTW I just improved optimization by adding preallocated strings for numbers between -1 and -9.
The bug is in line 2526 where Char.sizeof * maxlength is allocated but only maxlength is sliced for the buffer.
(In reply to comment #3) > The bug is in line 2526 where Char.sizeof * maxlength is allocated but only > maxlength is sliced for the buffer. Thanks! I just fixed the bug and checked in.