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

two examples of an prophecy in the story the Adventures of Odysseus Meaning two ways the future was told FOURTY POINTS!
Why light years are used to measure distances in the universe
scientific notation (2.5•10^4)(4•10^3)
The supervisor at the second job says, “I’ll give you a penny today and double your pay every day for 30 days if you’ll work for me.” What is the balance for t
A growing car dealership would like to expand its market with online sales. To do this, they want to allow customers to put together their own options and be ab
Anyone know the answer to 2 and 3
200 points O_o Which sentence has an incorrect shift in pronoun-antecedent agreement? A) The puppies in the kennel were whining their little hearts out. B) Stu
How do I solve this? I am completely lost! Please help!
** GEOLOGIST NEEDED** ** ROCK EXPERTS WANTED ** Absolute dating requires which of the following? knowledge of the order of layers of rock in a formation modern
what is the purpose of an argument's introduction