Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def nth(x, n, digits=1, system=10):
- if n < 0:
- return int(x / (system ** (abs(n) - 1))) % system ** digits
- else:
- return int(
- x / (system ** int(mlog.log(system)(x) - n))
- ) % system ** digits
Add Comment
Please, Sign In to add comment