Skip to content

Instantly share code, notes, and snippets.

@sslotsky sslotsky/crash.re
Created Jan 7, 2019

Embed
What would you like to do?
let percentCovered = (x, y) => {
let (x, y) = (min(x, y), max(x, y));
let amountCovered = sites^ |> List.fold_left((sum, site) => {
sum +. (min(site.right, y) -. max(site.left, x))
}, 0.0);
100.0 *. amountCovered /. (y -. x);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.