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

what other areas beside egypt did the new kingdom pharoahs conquer
what other areas beside egypt did the new kingdom pharoahs conquer
which city was located nearest the nile river delta
Which two numbers have a difference of 5 and a product of 3.36???
If you are writing a persuasive essay in favor of banning vending machines in schools, which is a counterargument you might anticipate?
write words to match the expression. 24- ( 6+3)
If you are writing a persuasive essay in favor of banning vending machines in schools, which is a counterargument you might anticipate?
what other areas beside egypt did the new kingdom pharoahs conquer
If you are writing a persuasive essay in favor of banning vending machines in schools, which is a counterargument you might anticipate?
write words to match the expression. 24- ( 6+3)