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 two parts make up the lithosphere
what is looping in QBASIC​
This map shows the spread of Buddhism. Based on the information in this map, which of the following statements is true? Buddhism started in India and spread no
Solve: 9(x^2+1/x^2) -9(x+1/x)-52=0​
is it better to amend a state constitution many times or to rewrite it completely?​
How did Enlightenment ideas impact the development of economic, political, and religious structure in the western world?
Which indicates that someone has a positive body image
In the problem 4 × 12 = 48, which numbers are the factors?       A. 4 and 12  B. 12 and 48  C. 4, 12, and 48  D. 4 and 48 ​
How should the sentence below be correctly written? Julia asked her manager if she could move from being a hostess to being a waitress, because she could use a
What is the quotient (3x^4-4x^2+8x-1)/(x-2)?