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 phase of mitosis is shown in the diagram below
10. Two primary sites for the polio virus replication?
Determin d/dx (x²+1) (7x-3) and d/dt(3t-2/5t+1)
Chase went for a hike. He left at 8:00 A.M. At 10:00 A.M., he took a half-hour rest. Chase returned home at 12:00 noon. While walking, Chase averaged 5 km/h. Ho
what are differences between Ram and Rom?​
Simplify: (x-1)+(12–7.5x)
The vertical component of 9N is found to be four-thirds of the horizontal component. a) Find the horizontal component. b)Find the magnitude of the vector​
Which of the following statements is true?
During a NASCAR race a car goes 58 m/s around a curved section of track that has a radius of 260 m. What is the car's acceleration?
Question 5 of 10 Though Japan's imperial system is thousands of years old, Japanese emperors had very little power during the 17th, 18th, and 19th centuries. In