1 matches bool, 2 matches long

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Apr 28 16:37:22 PDT 2013


On 4/28/13 7:19 PM, Mehrdad wrote:
> Integer logic: 1 + 1 = 2 = 0 (mod 2)
> Boolean logic: 1 + 1 = 1 = 1

Well D doesn't implement Boolean operators for + and *. Instead, one 
would need to use | and & respectively. When + and * are used with bool, 
promotion to int happens.

I think it's safe to assume D will never implement the Boolean meaning 
of + and *.


Andrei


More information about the Digitalmars-d mailing list