He uses binary operators on numbers in the set of integers

>he uses binary operators on numbers in the set of integers.

Other urls found in this thread:

tutorialspoint.com/cprogramming/c_bitwise_operators.htm
twitter.com/NSFWRedditImage

This. Whenever I see a xor swap I know the code is shit.

Elaborate please

What?
You mean doing a+b where a and b are integers is bad?

What did he mean by this?

That's a big katana.

really?

nah its just a manlet

For you.

Good damn that's cool.

Screw the haters.

No it's switching the values if variables a and b by using XOR rather than and intermediate variable c

Be honest, if you saw that guy and he demanded your wallet you'd give it to him

isn't that a nodachi?

washing pole

And what's so bad about that?

He's probably too weak to wield it properly.

looks like a charityshop highlander

Aren't bitwise operations nearly always faster than division, even on integers?

Beta detected.
I could easily outrun this scrawny kid.

If you don't use optimization it is.

>Tfw xor swap is slower and people still use it

Optimizers take care of that. Using them in unintuitive situations just makes your code unreadable.

Also, the xor-swapping thing is actually slower then whatever modern optimizers produce with an intermediate variable. Look at the assembly produced by:

void swap_xor(int *x, int *y)
{
*x ^= *y;
*y ^= *x;
*x ^= *y;
}


and

void swap(int *x, int *y)
{
int z = *x;
*x = *y;
*y = z;
}


You'll see that the first one usually produces much more instructions than the second one. The reason is that in order to xor the variables, they need to be moved into registers anyway, so instead of applying the xor operation you might just as well put them back into different places. Looking at it like that, the xor method is actually kind of ridiculous.

Yeah, I remember reading that the xor swap isn't really useful anymore besides in situations where memory is at a premium.

Don't know if you know this, but there was a saying in Japan.
'The bigger the user's blade, the smaller his penis.'
Your conclusion.

> he uses next line style in C

>he doesnt suck multiple cocks at all times

It's stupid. It's doing things terribly for the sake of being different. It's an easy way to introduce bugs when you would never need to. It's like using gotos instead of loops. It's stupid and people who go it are retards.

+, -, /, *, %, &, |, and ^, , &&, and || are all binary operators that apply to integers. Are you telling me I cannot do any arithmetic on integers whatsoever?

OP mentioned nothing about XOR swap, although it is incredibly inefficient, especially on RISC architectures that would have to make numerous loads/stores with XOR swap.

Please stop
tutorialspoint.com/cprogramming/c_bitwise_operators.htm

What about this?
*x -= *y;
*y += *x;
*x = *y - *x;

OP is deriding the use of any binary operators, not merely bitwise operators. If it takes two operands, it is a binary operator. Incidentally, ~ is not a binary operator; it is a unary operator. Despite this, your link refers to the bitwise negation operator as a "Binary Ones Complement Operator"

Yes, arithmetic operations use inefficient XOR and have to be executed sequentially, which has massive overhead.

While you're technically correct, everyone (except you), understood the post.