You are viewing a single comment's thread. Return to all comments →
You could reduce memory slightly by leaving out the declaration and assignments of rem and just use the n%2==1 condition in the first if statment.
rem
n%2==1
if
Also, it would reduce the checks against your max if you nested that check into the increase max branch of your if tree.
Minor changes, but could potentially go a long way in real world complex computations, particularly if you can eliminate this need in multiple areas.
Seems like cookies are disabled on this browser, please enable them to open this website
Day 10: Binary Numbers
You are viewing a single comment's thread. Return to all comments →
You could reduce memory slightly by leaving out the declaration and assignments of
rem
and just use then%2==1
condition in the firstif
statment.Also, it would reduce the checks against your max if you nested that check into the increase max branch of your
if
tree.Minor changes, but could potentially go a long way in real world complex computations, particularly if you can eliminate this need in multiple areas.