Last active
October 13, 2017 05:12
-
-
Save susisu/a5efa95ff72f5f3d10489b95c46183cd 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* seq(a, b, delta = 1) { | |
let num = a; | |
let correction = 0; | |
while (num <= b) { | |
yield num; | |
const delta_ = delta - correction; | |
const next = num + delta_; | |
correction = (next - num) - delta_; | |
num = next; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment