3 ms·
So what if x > MAXNUMBER/2 ? Also, how can this be faster than x=0-x; ?
by joosteto 9y ago
So what if x > MAXNUMBER/2 ?
Also, how can this be faster than
x=0-x;
?
- infogulch 9y agoThis took me a second to realize this is satire too.
- jwilk 9y agoIt's a joke. And yeah, it gives wrong answers for some numbers. BTW, JS has unary minus, so you can write: x = -x
- IncRnd 9y agoI think the author chose a more efficient table-driven approach, due to the extra 0 in your 0-x expression.