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 would happen to life on earth if all the liquid fresh water were used up? a. all organisms would adapt to using salt water. b. organisms would carry out
Three out of four students in your class have brought in permission slips for the next field trip. There are 32 students in the class. How many students still n
How is perspiration related to recovery after exercise?
in what south American country have hydrolyzed geodesic been found
please help me fill in the blank
What is the next value? 1 I 2 L 3 F 4
Keith is saving money for a car. He has saved the same amount each year for the past three years, and records how much he has at the end of each year in the tab
how can we solve ax + z = aw - y for a
How many lines are determined by two points? A. 0 B. 1 C. 2 D. Infinite
how does the yarn in the sweater differ from woool on the sheep