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

When animal cells are grown in a petri dish, they typically stop dividing once they have formed a single, unbroken layer on the bottom of the dish. this arrest
Is Shmuel naive? (From the boy In the striped pyjamas)
Which kind of adjectives is used most frequently in ordinary speech or writing
Please answer this for me
HELP ME PLEASE WILL PICK BRAINLYEST
What is the value of w? w + 3 4 = w - 2 2
Fix any punctuation or capitalization errors below. Click "Submit Answer" if there are none. ? , I bought a plate of soft, warm, gooey brownies from Monty Burns
Joanna is experiencing severe anxiety. her psychiatrist attributes her disorder to a chemical imbalance. her psychiatrist is using the ___________ of abnormalit
The purpose of cellular respiration is to _______ a) change the suns energy into chemical energy b) convert glucose to ATP c) store carbohydrates
Simplify Z^5x^2/z^4x^6