1.0.0 • Published 11 years ago
interval-intersection v1.0.0
interval-intersection
compute the intersection of two intervals where an interval is a 2 part array
install
npm install interval-intersection
use
var iisect = require('interval-intersection');
console.log(iisect([-1, 5], [0, 3]));
// output: [0, 3]
console.log(iisect([-2, -1], [1, 2]));
// output: nullapi surface
iisect(a, b, out)
ais the first intervalbis the second intervaloutis an optional 2 part araray. Provide this to avoid generating garbage- returns: 2 part array or
nullif no intersection
license
1.0.0
11 years ago