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

Write the equilibrium expression for the following reactions: 1. 4NH3 (g) + 5O2 (g) ↔ 4NO (g) +6H2O (g) 2. ZrI4 (s) ↔ Zr (s) + 2I2 (g) 3. NH3 (g) + HCl (g) ↔ NH
How long should Menstruation last?​
Please help me with this, much thanks!
Read this text, which Rhonda is planning to use in an argumentative essay in favor of pet ownership. “Many people don’t know that owning a pet is actually good
After turning on the power source connected to your two electrodes, we expect to see the microbeads moving through the solution. What forces are acting on the m
solve for r. r - 4.5 < 11
please eeeeeeee34frref​
Write at least 3-4 sentences summarizing a story about AthenaGreek goddess​
A triangle's base is increasing at the rate of 3 inches/sec, its height at 2 inches/sec. At what rate is the area of the rectangle increasing when base is 10 in
What is the volume of a bubble if the original was .25 m^3 at 4 atm and the pressure was reduced to 1 atm?