Freshman year of college doing assembly programming, I spent a while figuring out a “programmic” way to solve a problem, trying to wrangle labels and gotos. My friend came in with essentially this but as lookup table. It blew my mind.
It was then that I learned to trade space for complexity.
How about
x=x-x
x++
x++
x++
x++
x++
x++
x++
x++
x++
x++
Freshman year of college doing assembly programming, I spent a while figuring out a “programmic” way to solve a problem, trying to wrangle labels and gotos. My friend came in with essentially this but as lookup table. It blew my mind.
It was then that I learned to trade space for complexity.
Make sure you initialize x with
x=x/x-x/xfor better precisionWhat if it’s already 0?
Just add
// @TODO find out why this crashes our application sometimesto fix that issue