A strange div bug on Linux x86_64, (both dmd & ldc2): long -5000 / size_t 2 = 9223372036854773308

claptrap clap at trap.com
Fri Aug 14 09:49:45 UTC 2020

On Friday, 14 August 2020 at 09:12:50 UTC, Walter Bright wrote:
> On 8/13/2020 10:47 PM, Simen Kjærås wrote:
> As for intuitive, what that really means is what you're used to.

Everybody is used to -50/2 = -25. I'd argue that intuition is far 
more fundamental than 2 compliment. I'd also argue a lot of 
experienced C/C++ programmers would probably get caught out by 
that bug because it's the kind of thing that's easy to forget or 

That's why it should be an error.

I reckon most C/C++ people would think it's actually a good idea.

More information about the Digitalmars-d mailing list