[Issue 1219] long.max.stringof gets corrupted
Don Clugston
dac at nospam.com.au
Mon May 7 08:16:29 PDT 2007
d-bugmail at puremagic.com wrote:
> http://d.puremagic.com/issues/show_bug.cgi?id=1219
>
>
>
>
>
> ------- Comment #1 from fvbommel at wxs.nl 2007-05-07 09:42 -------
> Another interesting case, likely related:
> ---
> import std.stdio;
> import std.string;
>
> void main() {
> writefln(long.max.stringof);
> writefln(ulong.max.stringof);
> }
> ---
> The first three bytes of long.max.stringof seem to be overwritten by "-1\0".
> ulong.max.stringof is incorrectly displayed as "-1".
> If you change the order, the first three characters of long.max.stringof
> overwrite the characters of ulong.max.stringof (including the trailing \0).
I've seen similar things, and I think it is related to the ".". It can
happen to floating-point numbers as well, when they contain a decimal point.
More information about the Digitalmars-d-bugs
mailing list