modulus redux

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Jul 12 22:57:50 PDT 2009


TomD wrote:
> Andrei Alexandrescu Wrote:
> 
> [...]
>> The  multiplicative expressions  are multiplication  (\ccbox{a  * b}),
>> division  (\ccbox{a  / b}),  and  remainder  (\ccbox{a  \% b}).   They
>> operate  on numeric types  only. The  result type  of either  of these
>> operations   is  same  as   the  type   of  \ccbox{true   ?  a   :  b}
>> (see~\S~\ref{sec:conditional-operator}).
> 
> Isn't (true?a:b) always (a)?

Yes, but the type of the expression may be different from the type of a.

Andrei



More information about the Digitalmars-d mailing list