Skip to content

Instantly share code, notes, and snippets.

@mikaturk
Last active December 19, 2016 09:22
Show Gist options
  • Save mikaturk/b5aa50747d2280793e06ccd66162ffe8 to your computer and use it in GitHub Desktop.
Save mikaturk/b5aa50747d2280793e06ccd66162ffe8 to your computer and use it in GitHub Desktop.
export function riemann(f, xmin, xmax, step) {
let total = 0;
for (let i = xmin/step; i<xmax/step; i++) {
total += f(i*step)*step;
}
return total;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment