Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
joosteto
on Jan 20, 2018
|
parent
|
context
|
favorite
| on:
GG-flip: simplest and most efficient ways to flip ...
So what if x > MAXNUMBER/2 ?
Also, how can this be faster than x=0-x; ?
infogulch
on Jan 20, 2018
|
next
[–]
This took me a second to realize this is satire too.
jwilk
on Jan 20, 2018
|
prev
|
next
[–]
It's a joke. And yeah, it gives wrong answers for some numbers.
BTW, JS has unary minus, so you can write:
x = -x
IncRnd
on Jan 21, 2018
|
prev
[–]
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:
Also, how can this be faster than x=0-x; ?