0 < negative loop condition bug or misunderstanding on my part
H. S. Teoh
hsteoh at quickfur.ath.cx
Tue Mar 6 22:30:01 PST 2012
> On 03/06/2012 10:05 PM, ixid wrote:
> > Ah, thank you, so it's wrapping. That seems like a bad idea, what is
> > the benefit to size being unsigned rather than signed?
Because it doesn't make sense to have something with a negative size?
> > This case would seem like one where allowing negatives is clearly
> > better and more intuitive.
Not necessarily. For example, int.max+1 is a very large negative number,
and -int.min is still a very large negative number. :-)
T
--
Be in denial for long enough, and one day you'll deny yourself of things you wish you hadn't.
More information about the Digitalmars-d-learn
mailing list