You can convert an boolean to a integer value as show below:

i = (b)?1:0;