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

The Tudor monarchs of 16th century England used the Court of the Star Chamber to...? A:promote the commerce of the kingdom B:replace Parliament as a legislative
Any number that is divisible by 4 is divisible by 8. Find a counter example to show that the conjecture is false
what adventure did Polydectes suggest that Perseus undertake?
What did the Puritans of Massachusetts hope to create?
If f(x) = 2x2 − 10, find f(5). 90 10 7.5 40
Which of the following best describes one contribution of the Tuskegee Airmen during World War II? They flew missions over the US. They supported the troops. Th
a yogurt costs 55 pence . how many yogurts can be bought for 3 pounds
Does the First Amendment Affect Our Lives Today
The great compromise was between which two groups
PLEASE HELP ME Which of the following correctly compares how Chief Justice John Marshall and President Andrew Jackson felt about federal government being involv