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

Enter a range of values of x
It is urgent plz answer
Show that (a - b)+(b-c)+(c -a)3 = 3 (a - b) (b -c) (c-a)​
The average of three numbers is 25. two of the numbers are 45 and 16. What is third one.
2. Determine which of the following angle measures are correct. Select two that apply. 60°
which expression is equal to 5√2/√13 1. √65/2 2.√26/133.5√25/13 4.5√26/√13
Marked price of a camera is Rs.5000. If itsold at 15% discount, what will be discount amount?​
What are the next three terms in the sequence -27, -19, -11, -3, 5, ...?
You are given a mixture of sand, sugar and sulphur. Give the method you will use to separate the three constituents. ___________
what is the differences between amorphous solid and crystalline solid​