Thread overview | |||||
---|---|---|---|---|---|
|
June 10, 2013 decimal to binary | ||||
---|---|---|---|---|
| ||||
Hello, I searched a lot in the docs and search, but couldn't find anything so far. Is there a funtion, which converts my decimal number into a binary? |
June 10, 2013 Re: decimal to binary | ||||
---|---|---|---|---|
| ||||
Posted in reply to snow | On Monday, 10 June 2013 at 09:46:42 UTC, snow wrote: > Hello, > I searched a lot in the docs and search, but couldn't find anything so far. Is there a funtion, which converts my decimal number into a binary? http://dlang.org/phobos/std_string.html#.format with format string "%b". Or if you're printing, you can go straight with http://dlang.org/phobos/std_stdio.html#.writef. |
June 10, 2013 Re: decimal to binary | ||||
---|---|---|---|---|
| ||||
Posted in reply to snow | On Monday, 10 June 2013 at 09:46:42 UTC, snow wrote:
> Hello,
> I searched a lot in the docs and search, but couldn't find anything so far. Is there a funtion, which converts my decimal number into a binary?
I presume your decimal is in a string?
use
std.conv.parse
or
std.conv.to
|
Copyright © 1999-2021 by the D Language Foundation