Integer promotion... what I'm missing? (It's monday...)
Lionello Lunesu
lio at lunesu.remove.com
Mon Jun 19 05:35:30 PDT 2006
Tony wrote:
> I would prefer that any type promotions (and any implicit operations for
> that matter) should guarantee not to introduce any data corruption. In this
> case, promote both numbers to a third type which can hold all possible
> values from both.
I agree!
Perhaps this could also prevent the "array.length-1" bug (which is ~0
when array.length == 0), by making "array.length-1" a "long" instead of
a "uint".
L.
More information about the Digitalmars-d-learn
mailing list