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

How do you write the simplest form for 3/18 and explain it to me
Differing interpretations of the Bible by Christians in Europe eventually led to the Reformation. the Hundred Years’ War. the Black Plague. the Italian wars.
Which does not explain why people went west during the mid-1800s? A. They were looking for better economic opportunities. B. They wanted to homestead on free go
What was the purpose of keeping the discussions within the constitutional Convention a secret?
Which is greater, 8.0 or 0.8? Explain .
How do you simplify 420/1980?
When Sean stands on a box, he is 10 feet tall. If the box is 4 feet tall, write and solve an addition equation to find Sean's height.
What is the simplified version of 10/20?
round 13 .3 to the nearest whole number
Why does the heart automatically adjust the flow of blood to match activity levels? A. Extreme activity damages blood cells and the body needs replacements. B.