Integer promotion... what I'm missing? (It's monday...)
Deewiant
deewiant.doesnotlike.spam at gmail.com
Mon Jun 19 06:39:10 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.
>
What should be done when one number is an ulong too big to fit in a long and the
other is a negative number? (Replace "long" with "cent" if we ever get the
type.) No matter how the promotion is done, corruption occurs.
I think a warning for all such cases would suffice --- I thought one would be
emitted for the original code, but evidently not.
More information about the Digitalmars-d-learn
mailing list