[Issue 16554] Wrong result of string constant

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Sep 27 19:31:46 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16554

Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
                 CC|                            |schveiguy at yahoo.com
         Resolution|---                         |INVALID

--- Comment #3 from Steven Schveighoffer <schveiguy at yahoo.com> ---
(In reply to apham from comment #2)
> 	writeln('-', " minus#: ", cast(int) '-');
> 	writeln("-", " len: ", "-".length);
> 	writeln("-1", " len: ", "-1".length);
> 	writeln("-12345", " len: ", "-12345".length);

All of the above are using normal ascii dash character (byte 0x2d).

> 	writeln("–2_147_483_648", " len: ", "–2_147_483_648".length);

This uses different character, it even appears different on my display
(sequence 0xe2 0x80 0x93). Try this instead:

     writeln("-2_147_483_648", " len: ", "-2_147_483_648".length);

--


More information about the Digitalmars-d-bugs mailing list