possible bug in std.conv.parse

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Sat Apr 26 17:01:22 PDT 2014


On 4/26/14, 4:43 PM, Adam D. Ruppe wrote:
> On Saturday, 26 April 2014 at 23:36:28 UTC, ketmar wrote:
>> this code: std.conv.parse!byte("-128") throws error: "Overflow in
>> integral conversion". but this is obviously not true, as signed byte
>> can hold such value.
>
> Check your math... the most negative number a signed byte can hold is
> -127. The most positive number it can hold is 128, but negating that
> wouldn't fit in eight bits.

Oops. No bug. -- Andrei


More information about the Digitalmars-d mailing list