possible bug in std.conv.parse

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Sat Apr 26 16:46:31 PDT 2014


On 04/27/2014 01:43 AM, 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.

Check your math. :o)


More information about the Digitalmars-d mailing list