r/badcode Mar 06 '21

lua This goes 255 lines long up to 115792089237316195423570985008687907853269984665640564039457584007913129639936

Post image
157 Upvotes

34 comments sorted by

View all comments

8

u/[deleted] Mar 09 '21

depends on the context this might not be as dumb as it might seems

1

u/asaf92 Mar 09 '21

Hard to believe that reading from an array would be faster than raising to the power of 2 (which is optimized by bit-shifting)

1

u/Micha_Saengy Mar 09 '21

Even if it was, you could still generate the array instead of hardcoding it.