Hacker News new | past | comments | ask | show | jobs | submit login

So what if x > MAXNUMBER/2 ?

Also, how can this be faster than x=0-x; ?




This took me a second to realize this is satire too.


It's a joke. And yeah, it gives wrong answers for some numbers.

BTW, JS has unary minus, so you can write:

    x = -x


I think the author chose a more efficient table-driven approach, due to the extra 0 in your 0-x expression.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: