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

how have computers changed mapmaking in recent years
A snowball is launched horizontally from the top of a building at v = 16.9 m/s. If it lands d = 44 meters from the bottom, how high (in m) was the building?
A snowball is launched horizontally from the top of a building at v = 16.9 m/s. If it lands d = 44 meters from the bottom, how high (in m) was the building?
what are three ways water erodes the surface of earth
two methods of active transport
What were the 4 major truths Jefferson presented in the declaration of independence?
10u + 7 = 8 ( 2u - 4 ) - 9
2 ( 4a - 12 ) + 3a = 6a + 1
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?