-
Senior Member
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.
-
Please, Call Me Bob
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.
-
Senior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|