mirror of
https://github.com/josdejong/mathjs.git
synced 2025-12-08 19:46:04 +00:00
* feat: add polynomialRoot function This is intended as a benchmark for general arithmetic/basic algebra functionality of mathjs, but was chosen to be something of potential independent utility as well, worth adding to mathjs in its own right. Currently ol=nly computes the numerical roots for real or complex polynomials of degree three or less. As usual, adds documentation, embedded documentation, tests, TypeScript declaration, and TypeScript tests. Also updates doc.test.js to make it easier to specify an array of complex numbers as the expected output, and comapres with the appropriate fuzz in such cases. Finally, adds a benchmark that computes the roots of all cubics with nonnegative integer coefficients no larger than five. * doc: fix typo in polynomialRoot embedded docs Thanks, SamuelTLG * style: avoid slightly cryptic Boolean flag stand-in