Created
July 9, 2016 12:42
-
-
Save veox/b783b98acc8fbc503806a900e88a3938 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
#!/usr/bin/python | |
import math | |
# round precision | |
rp = 3 | |
# vote weight - square | |
def vws (stake, duration): | |
return round(stake * duration * duration, rp) | |
# vote weight - root | |
def vwr (stake, duration): | |
return round(stake * math.sqrt(duration), rp) | |
stakes = [1, 10, 100, 1000] | |
durations = list(range(1,8)) | |
print("Square:") | |
for d in durations: | |
print([vws(s,d) for s in stakes]) | |
print() | |
print("Root:") | |
for d in durations: | |
print([vwr(s,d) for s in stakes]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment