Bug 14503 – BigInt to binary/octal and lower case "%x" (hexadecimal format)

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-04-26T12:05:00Z
Last change time
2016-12-23T21:07:26Z
Keywords
pull
Assigned to
nobody
Creator
dennis.m.ritchie

Comments

Comment #0 by dennis.m.ritchie — 2015-04-26T12:05:36Z
I believe that we need to add new format specifiers for the data type BigInt also need to fix the uppercase letters to lowercase hexadecimal specifier "%x": ----- import std.bigint : BigInt; import std.string : format; import std.stdio : writeln, writefln; void main() { BigInt n = 15; string s = format("%x", n); // does not work properly writeln(s); writefln("%x", n); // prints F is a bug // and to print a lower case /*string t = format("%b", n); // Format specifier not understood: %b writeln(t); // does not work writefln("%b", t); // does not work */ /*string test = format("%o", n); // Format specifier not understood: %o writeln(test); // does not work writefln("%o", test); // does not work */ }
Comment #1 by electrolysis.jp+d — 2015-04-28T10:57:31Z
Fix BigInt.toString with "%x" https://github.com/D-Programming-Language/phobos/pull/3240 > I believe that we need to add new format specifiers for the data type BigInt +1.
Comment #2 by github-bugzilla — 2015-06-30T17:56:04Z
Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/47dfc369b07d62988682404edf7b4a95dec93480 Merge pull request #3240 from e10s/issue14503 Fix BigInt.toString with "%x"
Comment #3 by github-bugzilla — 2015-10-04T18:19:50Z
Comment #4 by hsteoh — 2016-02-12T23:36:12Z
Comment #5 by github-bugzilla — 2016-03-31T20:56:44Z
Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/630e227c5a50985cbd5d96144e3dcb95ec9aef21 Merge pull request #3992 from quickfur/bigint_octal Issue 14503: Implement formatting BigInt in octal
Comment #6 by andrei — 2016-12-23T21:07:05Z
Comment #7 by andrei — 2016-12-23T21:07:26Z
(In reply to Andrei Alexandrescu from comment #6) > https://dlang.org/phobos/std_array.html#replicate sorry, wrong issue!