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

Gymnast Clothing manufactures expensive soccer cleats for sale to college bookstores in runs of up to 500. Its cost (in dollars) for a run of x pairs of cleats
Please help with the tennis court one.
The development of the shipbuilding and cod fishing industries during the colonial era would have had the biggest impact on which colony? question 5 options: no
How much energy is needed to melt 25.4 grams of I2? Hfus=61.7 J/g Type the correct answer to 3 digits. If the answer has an exponent, type the number, then ^, t
How to draw a grid of area of 12 square centimeters and a perimeter of 16 centimeters?
Let’s assume that one drop is equal to 50 µl. a total of 2366 drops will fill how many tablespoons?
use the word adhere in a sentence
Solve the triangle. A = 46°, a = 31, b = 27
Sarah has $20 saved. If she will save her allowance for the next 3 weeks, and she gets $10 per week for her allowance. At the end of the week, she gets $150 in
What is the volume of a rock with a density of 3.00 g/cm3 and a mass of 600g?