Thread overview
BigInt to binary
Apr 25, 2015
Dennis Ritchie
Apr 25, 2015
Marc Schütz
Apr 25, 2015
Dennis Ritchie
Apr 25, 2015
Ali Çehreli
Apr 26, 2015
Dennis Ritchie
April 25, 2015
Hi,
Is there a way to apply a function "format" with BigInt?

-----
import std.stdio, std.bigint, std.string;

void main() {

	BigInt n = -10;

	string s = format("%b", n); // error

	writeln(s);
}
April 25, 2015
On Saturday, 25 April 2015 at 13:13:10 UTC, Dennis Ritchie wrote:
> Hi,
> Is there a way to apply a function "format" with BigInt?
>
> -----
> import std.stdio, std.bigint, std.string;
>
> void main() {
>
> 	BigInt n = -10;
>
> 	string s = format("%b", n); // error
>
> 	writeln(s);
> }

BigInt only supports %d, %x, %X and %s:
http://dlang.org/phobos/std_bigint.html#.BigInt.toString

The missing %o and %b were probably an oversight, feel free to file an enhancement request or submit a PR.
April 25, 2015
On Saturday, 25 April 2015 at 18:58:50 UTC, Marc Schütz wrote:
> BigInt only supports %d, %x, %X and %s:
> http://dlang.org/phobos/std_bigint.html#.BigInt.toString
>
> The missing %o and %b were probably an oversight, feel free to file an enhancement request or submit a PR.

All right. I will file a request.

Just tell me, please, in which section should apply similar requests?
https://issues.dlang.org/
April 25, 2015
On 04/25/2015 01:23 PM, Dennis Ritchie wrote:
> which section should apply similar requests?
> https://issues.dlang.org/

After clicking "File and Issue":

Component: Phobos
Severity: Enhancement

Ali

April 26, 2015
On Saturday, 25 April 2015 at 21:13:29 UTC, Ali Çehreli wrote:
> On 04/25/2015 01:23 PM, Dennis Ritchie wrote:
>> which section should apply similar requests?
>> https://issues.dlang.org/
>
> After clicking "File and Issue":
>
> Component: Phobos
> Severity: Enhancement
>
> Ali

Thanks. I reported this:
-----
https://issues.dlang.org/show_bug.cgi?id=14503