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 is 0.8% written as a decimal
what is 1/9 of 60 equal
I am a polyhedron. I am a prism. my two bases are hexagon. my two other faces are rectangles.
how many rectangular prism can you make out of 20 snap of cubes
What steps did president Wilson have to take to make an official declaration of war?
During the evolution of life on Earth, the photosynthetic organisms initially responsible for raising atmospheric oxygen concentrations from less than 1 percent
25% of what nember is 19
translate into an equation. Five times the sum of twice a number, x, and six is thirty. Find the number.x = Translate into an equation. The difference b
What is adaptation in animals and plants
What is adaptation in animals and plants