Last active
August 29, 2015 14:27
-
-
Save diegoaguilar/46f7fc285f1a37c35ec1 to your computer and use it in GitHub Desktop.
This file contains 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
Dividing x by Math.pow(10, n) shifts x by n digits to the right: 123123123 / 10^10 = 0.0123123123, | |
that way you can turn any number between 0 and 10^n-1 into a value between 0 and 1. | |
Subtracting it from 1 reverses the order, so that older is smaller (so results in a better rank value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment