Skip to content

Instantly share code, notes, and snippets.

@mattbasta
Forked from JordanReiter/Logarithmic generator
Created December 14, 2012 04:23
Show Gist options
  • Save mattbasta/4282685 to your computer and use it in GitHub Desktop.
Save mattbasta/4282685 to your computer and use it in GitHub Desktop.
def log_gen(n):
import math
y = 1
while y < n:
adder = max(1, 10 ^^ int(math.log10(y)))
yield int(y)
y += adder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment