jasperzhouzihe2138 jasperzhouzihe2138
  • 03-02-2018
  • Mathematics
contestada

Assigned newbits with the opposite values of oldbits if flipbits is true. ex: if oldbits = [1, 1, 0, 1] and flipbits is 1, then newbits = [0, 0, 1, 0]

Respuesta :

kaliyahbenning2
kaliyahbenning2 kaliyahbenning2
  • 05-02-2018

Franck's answer is better (using ~), but I just wanted to point out that the conditional in yours is slightly redundant. It's easy to forget that, since you already have a boolean value, you don't need to perform a comparison in your conditional. So you could have just done this...

if x x = false; else x = true; end
Answer Link

Otras preguntas

Can someone help me with this plssss it would help so much! (IM GIVING LOTS OF POINTS!!!!!!!!)
It was a bad day for sales ,with the shoppers drifting ————,unwilling to ———
Mustafa is packing 7 copies of into this box . Mustafa puts one of the books in it it fits perfectly on the bottom with no space around edges all of the books f
Sarah has planted a total of 60 plants in her new garden.21 of these are sunflowers.What percentage of the plants are sunflowers?
Simplified result 7m-(3+5m)
If this person hav this what would the other person have
kay’s on is looking at two buildings, building A and building B at an angle of elevation of 73°. Building A is 30 feet away, and building B is 35 feet away. Whi
0.0058=5.8x10r what is the value of r in the equality belone
Please help me with this question... Fast...
Write two synonyms for this word transform