Y
Hacker News
new
|
ask
|
show
|
jobs
by
joosteto
3077 days ago
So what if x > MAXNUMBER/2 ?
Also, how can this be faster than x=0-x; ?
3 comments
infogulch
3077 days ago
This took me a second to realize this is satire too.
link
jwilk
3077 days ago
It's a joke. And yeah, it gives wrong answers for some numbers.
BTW, JS has unary minus, so you can write:
x = -x
link
IncRnd
3076 days ago
I think the author chose a more efficient table-driven approach, due to the extra 0 in your 0-x expression.
link