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

H. S. Teoh hsteoh at quickfur.ath.cx
Thu Aug 13 22:07:11 UTC 2020


On Thu, Aug 13, 2020 at 02:40:46PM -0700, Walter Bright via Digitalmars-d wrote:
> On 8/13/2020 12:03 PM, jmh530 wrote:
> > In other words, it was not added until 2014, and even then done in a
> > backwards compatible way that doesn't let you actually declare
> > unsigned ints, just to call some methods on them assuming they are
> > unsigned.
> 
> I view it as an admission of failure at doing away with unsigned
> integers.

Yeah, in spite of all the problems, unsigned values *are* needed for
certain things.  Java not having it was a *big* turnoff for me, because
certain things that ought to be simple become needlessly convoluted
(like parsing unsigned output from a C program, for example -- to
prevent silent data corruption you had to treat everything as strings,
which is a royal pain in Java).

Then again, a lot of things are needlessly convoluted in Java, so it's
not saying very much. :-P


T

-- 
People who are more than casually interested in computers should have at least some idea of what the underlying hardware is like. Otherwise the programs they write will be pretty weird. -- D. Knuth


More information about the Digitalmars-d mailing list