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

Describe the Ellis island. Why was it so important at the turn of the century?1900s
What is the difference? -6-(11) 1-17 -5 O 5 017
what is hotter 6000k or 3000k
Correct the errors 1 Nobody in my family like cold food for dinner. 2 Everybody were tired after the picnic . 3 somebody should be able to lend you his calcul
Can somebody answer this worksheet pls.
Look at the chart above. In which Eastern European country would you expect to find the highest standard of living? A. the Czech Republic B. Moldova C. Norway D
A fisherman noticed that a float makes 30 oscillations in 15 seconds. The distance between two consecutive crests is 2 m. What is the period and frequency of th
PLS HELPA shelf has different sizes of bottles of laundry detergent. This line plot shows the number of cups of laundry detergent in each bottle. Natalie buys t
What happens to electrons in ionic bonds?
Which of the following is most likely the next step in the series?