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 were the 4 major truths Jefferson presented in the declaration of independence?
What's breed of given cat???Check attachment
What were the 4 major truths Jefferson presented in the declaration of independence?
2 ( 4a - 12 ) + 3a = 6a + 1
on sara's computer, 3/8 of the hard drive is files. Of the files, 1/6 are games . What part of the hard drive is games?
on sara's computer, 3/8 of the hard drive is files. Of the files, 1/6 are games . What part of the hard drive is games?
Why did Henry Clay group his resolutions in pairs in the Compromise of 1850?
what are three ways water erodes the surface of earth
how have computers changed mapmaking in recent years
what type of rock is the Haystack rock (igneous, Metamorphic, or Sedimentary)