binary inversion

i know this is a bit of a maths question but how to i find the decimal opposite of an 8 bit binary number? like inverting all the bits? so say 255 becomes 0 and 0 becomes 255.

like 11111111
00000000
randomize usr 1234

Comments

  • PRINT 255-x
  • so whats x?
    randomize usr 1234
  • x is the number you want to invert (8-bit in the range 0-255). For 16 bit numbers you would subtract the number from 65535.
  • ok, ty

    and what about mirroring?
    randomize usr 1234
  • That's less trivial, especially in Basic without bitshift operators
  • I'm glad this was actually a computer related question instead of a weird thread about Woke bullshit :))
    Every night is curry night!
  • woke? what's that got to do with anything?
    randomize usr 1234
  • digital wrote: »
    woke? what's that got to do with anything?

    Absolutely nothing it was a joke pointing towards the title of the thread, which lots of overly sensitive people will no doubt be offended by.....Well if they have nothing better to do with their time anyway.
    Every night is curry night!
  • Well sh*t I stopped and thought about removing my last post (By which I mean editing it to say I got rid of it), but it appears that when I clicked edit I only had a few seconds left to do so. Oh well f*ck it! I have no real differing opinion to what I posted originally just thought I'd drop it so it didn't cause any blue haired soy boys to cry.


    Makes me feel though maybe we should extend the edit post feature beyond 1 hour, and maybe bring back the delete post feature, I mean really the only person who went on a mass deletion hasn't posted for ages....years even, at least not under the name he did.
    Every night is curry night!
Sign In or Register to comment.