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

if you rubbed a piece of topaz against a piece of Quartz, what would happen?
"My vegetable love should grow/Vaster than empires and more slow" is an example of A) paradox B) hyperbole C) metaphor D).simile Having a hard time, I'm temp
Rewrite 2 x 5 as the same number added to itself over and over
A Muslim is one who believes in Allah and strives for total reorganization of his or her life. He or she also works for building human society on the same basis
Which port city on the Sea of Japan is located near Russia's border with China? Where is the Russian port city of Murmansk located?
The Enrollment Act of Conscription, during the Civil War, caused the New York City_____ riots. A) Military B) Draft C) economic
what is the part of speech for unanimous
what are the two important jobs of photosynthesis
Your company spends 15% of their budget on rent each year. Their operating budget was $45,000.
Which feature is most likely to have been formed by wind? A. canyon B. root pry C. sand dune D. U-shaped valley