Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
April 25, 2015 BigInt to binary | ||||
---|---|---|---|---|
| ||||
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 Re: BigInt to binary | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dennis Ritchie | 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 Re: BigInt to binary | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marc Schütz | 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 Re: BigInt to binary | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dennis Ritchie | 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 Re: BigInt to binary | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ali Çehreli | 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 |
Copyright © 1999-2021 by the D Language Foundation