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

Solve for x. - 3x + 8y = 5 6x - 2y =10
Create a newspaper article about visiting the great exhibition, London.Could anyone please give me some points that I could include.Thank you
How do you get a liquid to a gas?
What is the are of the polygon below?
A forerunner of the Declaration of Independence was (A) the Proclamation of Rebellion (B) Lee’s Resolution (C) Suffolk Resolves (D) Declaration of Rights and Gr
multiple choice I realy need a help!!!!! 1) Eric lives in Aurora City.He read an article in his local newspaper about a proposed ordinance increasing the local
What are some quotes for of mice and men for the character Curley?
Why would a teacher say that meiosis is actually mitosis happening twice?
A car uses one gallon of gasoline for every 20 miles it travels. If a gallon of gasoline costs $3.98, how much will the gas cost, to the nearest dollar, to trav
what is 3(g-7)=2(10+g)