Package Exports
- citardauq-roots
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (citardauq-roots) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
citardauq-roots
Numerically stable method for solving
quadratic equations
Note: 'citardauq' is 'quadratic', reversed
Install
$ npm install --save citardauq-roots
Usage
const quadraticRoots = require('citardauq-roots')
console.log(quadraticRoots(1, 0, -1))
// => [1, -1]
console.log(quadraticRoots(1, -5, 6))
// => [3, 2]
console.log(quadraticRoots(1, -2, 1))
// => [1]
console.log(quadraticRoots(-4, 1, 3))
// => [-0.75, 1]
console.log(quadraticRoots(0, 2, 3))
// => Error: a can not be 0
console.log(quadraticRoots(1, 0, 1))
// => Error: No real roots
License
MIT © Nicolás Quiroz