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

In a research sample of high school students, the variable “number of Instagram followers” formed normal distribution with a mean of 45 and a standard deviation
Three couples and two single individuals have been invited to an investment seminar and have agreed to attend. Suppose the probability that any particular coupl
Calculate the distance between points x and y. Give your answer to 1 decimal place.
what’s the difference between a mixture and a substance
89.51 68.168 11.047 in order least to greatest
Which cell lacks a nucleus?
Do you think pricing for Super Bowl advertising is fair?
Which of the following is an end product of translation?
Accounts Receivable has a debit balance of $ 2 comma 500​, and the Allowance for Uncollectible Accounts has a credit balance of $ 500. A $ 80 account receivable
Peter's Party Zone sells cups in packages of 666 and plates in packages of 888. Shaniya is hosting a birthday party for her little sister and wants to have the