Is there any reason why arithmetic operation on shorts and bytes return int?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Dec 11 05:05:37 PST 2012


On 12/11/12 8:03 AM, d coder wrote:
>
>
> On Tue, Dec 11, 2012 at 6:23 PM, monarch_dodra <monarchdodra at gmail.com
> <mailto:monarchdodra at gmail.com>> wrote:
>
>     D's stance regarding integer operations is "if it compiles, it
>     creates the same output as in C".
>
>
> Thanks Monarch. So it is a gotcha we inherit from C. :-)

No, it's a fix of a gotcha from C. The C code would just allow the 
assignment.

Andrei



More information about the Digitalmars-d mailing list