digitalmars.D.learn - Type conversions in D
- Jean Cesar (10/10) Feb 21 2017 I once saw an article that talked about type conversions using
- Seb (5/15) Feb 21 2017 Note that what you are looking for is a library feature:
- Jean Cesar (6/26) Feb 21 2017 I'm not talking about it so I'm seeing what I've seen and I'm
- =?UTF-8?Q?Ali_=c3=87ehreli?= (11/38) Feb 21 2017 Just for clarification, what you've originally shown is formatting: no
I once saw an article that talked about type conversions using the D language. Type convert integer to exadecimal, binary, but I'm thinking of writing an article in my blog but I do not find the site I saw on to know more information of the same type as I did below. void main() { int a=15; writefln("O numero %s em binario é %b", a, a); }
Feb 21 2017
On Tuesday, 21 February 2017 at 21:39:37 UTC, Jean Cesar wrote:I once saw an article that talked about type conversions using the D language. Type convert integer to exadecimal, binary, but I'm thinking of writing an article in my blog but I do not find the site I saw on to know more information of the same type as I did below. void main() { int a=15; writefln("O numero %s em binario é %b", a, a); }Note that what you are looking for is a library feature: https://dlang.org/phobos/std_conv.html In fact every type can implement its own specific format handling: https://dlang.org/phobos/std_format.html
Feb 21 2017
On Tuesday, 21 February 2017 at 22:09:11 UTC, Seb wrote:On Tuesday, 21 February 2017 at 21:39:37 UTC, Jean Cesar wrote:I'm not talking about it so I'm seeing what I've seen and I'm looking for things about the integer conversion operators for exa, from exa to integer etc ... I saw this once on the tutorialspoint site but I went there and I can not find any more I know if it was removed.I once saw an article that talked about type conversions using the D language. Type convert integer to exadecimal, binary, but I'm thinking of writing an article in my blog but I do not find the site I saw on to know more information of the same type as I did below. void main() { int a=15; writefln("O numero %s em binario é %b", a, a); }Note that what you are looking for is a library feature: https://dlang.org/phobos/std_conv.html In fact every type can implement its own specific format handling: https://dlang.org/phobos/std_format.html
Feb 21 2017
On 02/21/2017 02:26 PM, Jean Cesar wrote:On Tuesday, 21 February 2017 at 22:09:11 UTC, Seb wrote:Just for clarification, what you've originally shown is formatting: no type conversion is involved. For type conversions, this is a must read anyway: https://dlang.org/spec/type.html#integer-promotions (And "Usual Arithmetic Conversions" there.) However, I think you're talking about literal syntax: https://dlang.org/spec/lex.html#integerliteral which I had attempted to rephrase here: http://ddili.org/ders/d.en/literals.html#ix_literals.literal AliOn Tuesday, 21 February 2017 at 21:39:37 UTC, Jean Cesar wrote:I'm not talking about it so I'm seeing what I've seen and I'm looking for things about the integer conversion operators for exa, from exa to integer etc ... I saw this once on the tutorialspoint site but I went there and I can not find any more I know if it was removed.I once saw an article that talked about type conversions using the D language. Type convert integer to exadecimal, binary, but I'm thinking of writing an article in my blog but I do not find the site I saw on to know more information of the same type as I did below. void main() { int a=15; writefln("O numero %s em binario é %b", a, a); }Note that what you are looking for is a library feature: https://dlang.org/phobos/std_conv.html In fact every type can implement its own specific format handling: https://dlang.org/phobos/std_format.html
Feb 21 2017