node package manager
Easy sharing. Manage teams and permissions with one click. Create a free org »

interval-divide

interval-divide

divide an interval by another where an interval is a 2 part array

Sources:

install

npm install interval-divide

use

var idiv = require('interval-divide');
 
console.log(idiv([1, 2], [3, 4]));
// output: [0.25, 0.66666666666666] 
 
console.log(idiv([1, 2], [0, 0]));
// output: [-Infinity, Infinity] 

api signature

idiv(a, b, out)

  • a is the first interval
  • b is the second interval
  • out is an optional 2 part araray. Provide this to avoid generating garbage
  • returns: 2 part array

license

MIT