Created
June 15, 2018 11:09
-
-
Save halfzebra/16f531ef196dc38a16100ecf4e9c931c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function powerOf10LessThan(number) { | |
return Math.floor(Math.log10(number)) | |
} | |
function step(number) { | |
return value + (10 ** powerOf10LessThan(number)) | |
} | |
function stepMany(number, steps) { | |
let res = value | |
for(let i = 0; i < steps; i++) { | |
res = step(res) | |
} | |
return res | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment