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 is the main idea of Truman's statement about the use of atomic weapons
which of the following suffered most from DDT poisoning in the great lakes region
What is the main idea of Truman's statement about the use of atomic weapons
Explain how engineers and scientists may work together to produce a protein in the lab.
what is the answer to this question -√(12)+5√(75)
what are two human uses for mosses?
Factor completely, the expression: 2x^3-2x^2-12x
how do I solve this proportion?
A certain test is worth 155 points. How many points (rounded to the nearest point) are needed to obtain a score of 65%?
In a sale, normal prices are reduced by 12% The sale price of a digital camera is £132.88 Work out the normal price of the digital camera (3marks)