Hi, I'm trying to use this library to find roots of arbitrary polynomials.
One issue I noticed is that running Algebrite.nroots("x^2 - 1") returns a pretty complicated-looking datatype instead of an array of the roots. So far the only way I've found to get the roots is to use .toString() to get a string representation of the array.
I guess this is useful for displaying the answer, but the program I'm building needs their numerical representation (either as floats, or as an instance of a Complex class). Is there a way to do this? I'd rather not have to write a function to parse the string and build the right array from it.
Hi, I'm trying to use this library to find roots of arbitrary polynomials.
One issue I noticed is that running
Algebrite.nroots("x^2 - 1")
returns a pretty complicated-looking datatype instead of an array of the roots. So far the only way I've found to get the roots is to use .toString() to get a string representation of the array.I guess this is useful for displaying the answer, but the program I'm building needs their numerical representation (either as floats, or as an instance of a Complex class). Is there a way to do this? I'd rather not have to write a function to parse the string and build the right array from it.