Post the most powerful programmers in the world in this thread. Mogs Carmack
Post the most powerful programmers in the world in this thread. Mogs Carmack
no way this isn't a troll
Well, at least this will pass fizzbuzz test.
ProbablyXD
Awesome. That's made my day XD. Thanks OP
This is someone who gets hired at FAGMAN while you do your shitty webdev and grind leetcode to be a code monkey for 35k/year.
What as? a comedian? XD
What retard uses the modulo operator to check the parity of a number? It's much faster to do a right shift, left shift, and equality check.
>right shift, left shift, and equality check.
Are you retarded?
just use n&1
no it isn't
Modulo requires a division, 2 shifts looks like an optimization for older machines?
$ gcc -c test.c -O2
$ cat test.c
int evenModulo(int a) {
return a%2;
}
int evenShift(int a) {
return (a
I hate women so much it's unreal.
Disassembly of section .text:
0000000000000000 :
0: 89 fa mov %edi,%edx
2: c1 ea 1f shr $0x1f,%edx
5: 8d 04 17 lea (%rdi,%rdx,1),%eax
8: 83 e0 01 and $0x1,%eax
b: 29 d0 sub %edx,%eax
d: c3 ret
e: 66 90 xchg %ax,%ax
0000000000000010 :
10: 89 f8 mov %edi,%eax
12: c1 e0 1f shl $0x1f,%eax
15: c1 f8 1f sar $0x1f,%eax
18: c3 ret
yes I know it returns 1 when it's odd;
>trying to determine parity
Gives it away.
kode thread, sweet
you know you can just do a bitwise and with a 1 right
>Klossys Koding Klub
What did they mean by this
Hmmm, doing one instruction, versus three. I wonder which scenario will have the least amount of latency?
>no way this isn't a troll
is even is a reddit meme. It's 100% troll.
He already demonstrated that shifting is fewer instructions with disassembly you mongoloid