Add positive root function of two algebraic numbers#57
Conversation
|
Looks good to me. Will see if @dddejan has comments. |
nafur
left a comment
There was a problem hiding this comment.
I'd suggest some improvements, mostly about comments/documentation.
I'm aware that my request go beyond the current average of libpoly, but libpoly should really improve in this respect... :-)
dddejan
left a comment
There was a problem hiding this comment.
Can you please add some tests.
The standard way is to add tests in Python. There is some work to add the new functionality to the Python API but this also helps make sure that the new API is useful.
You can follow what's already done in https://github.com/SRI-CSL/libpoly/tree/master/python to add the API. Then you can add the tests in https://github.com/SRI-CSL/libpoly/tree/master/test/python/tests.
27094db to
9a6e2cb
Compare
9a6e2cb to
f8251d5
Compare
return the true rational when is_rational is true by adding the case P(X)=den*X-num
f8251d5 to
82daf08
Compare
|
Thank you for the review, improving documentation is always important. Three tests are added (other tests in the file algebraic_number.py are failing). |
I mainly wanted to understand how the library was built, so the approach is surely very naive. But I though it was sad that the algebraic numbers only provide operations that the rational provides. So this MR adds an implementation of the positive root of a positive algebraic number.