A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: use for xor?

  1. #1
    Senior Member fantasio's Avatar
    Join Date
    May 2000
    Location
    at the progress bar
    Posts
    409

    use for xor?

    hello dear gurus of the numbercrunching departement!

    for years i treated the modulo operator with an unhealthy disregard.until i finally discoverd its power.

    so i wonder what might be the practical uses of the xor operator?

    any uses greatly appreciated!

    thanks a lot.

  2. #2
    Please, Call Me Bob trogdor458's Avatar
    Join Date
    Aug 2006
    Location
    Pensacola, FL
    Posts
    915
    Eh?
    I might be mixing this up because I remembered xor being an operation that would return true if only one of the conditions was true

    Modulus is just a shortcut for finding the remainder when dividing two numbers
    Useful for whenever you need that function
    a%b is the equivalent of a-Math.round(a/b)*b
    I recall the time it was most useful was with an assigned program that generated prime numbers

    If a%b==0, then b is a factor of that number, etc.

  3. #3
    Senior Member fantasio's Avatar
    Join Date
    May 2000
    Location
    at the progress bar
    Posts
    409
    you are absolutely right.

    what i wanted to say is:
    after realizing how cool modulo can be in certain situations i would like to see for what i could use xor for.
    like:
    after using a wrench, and seeing how useful it can be i would like to find uses for a hammer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center