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