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

A triangle has side lengths of 7, 8 and 12. Classify the type of triangle.
please answer this thx
I have had lymph nodes for years. Is this a sign of cancer?.
What are the values of (-8)^2 and -8^2 A. 64 and -64 B. 16 and 16 C. 64 and 64 D. 16 and -16
write a story about a 17 year old who lives in london​
Which equation represents a line which is parallel to the line y = 5x-2
Which phrase describes the context for this speech?
Lee harvey oswald's face when he was told he was charged with murder.
Alzheimer’s disease: a. Marks mental decline or dementia. B. Results in the progressive deterioration of brain cells. C. Both a and b. D. Neither a nor b. Pleas
Nora ordered a set of purple and green pins. She received 50 pins, and 70% of them were purple. How many purple pins did Nora receive?