Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Thanks for the advice, hope it is clearer now.
I think that the precision errors will be infinite since we have infinite decimal places and the rounding error will always be present, I thought that with an error of 1E-10 I would catch a large part of those results that caused the error.
In addition, infinite random numbers are not generated, they are generated in a small range between -5 and 20 to force the matrices whose result is null, so the calculation with the error is enough to save those precision errors.
then there shouldn't be any issue with the test suite, because when a width or height is negative, its root is not calculated, and None or null is returned
My head is going to explode with this problem. Could you share your code to see what could be the error?
I have a solution using BigDecimal and it doesn´t crash in any test case.
My mistake, i forgot to change it in my last edit, should be fixed by now.
It should be fixed, instead of using BigDecimal you can use an approximate error of 1E-10 to solve it, and then you can use Double without any problem.
Thanks for the feedback, if there are more issues please let me know.
Thanks for the feedback, i have fixed it. If there is something else i should change, please let me know.
I have already changed the return type. If there is something else that I should change, let me know it.
Thanks for the feedback.
My problem is that the
math
methods to calculate the roots or, failing that, the powers, requireDouble
as parameters and will round it as aDouble
.Thanks for the comment, i didn´t even expect that result. I have fixed the description suggesting not to use Double or Float to avoid losing decimals. I don´t know if it is really the solution for that issue, if not, please let me know.
I have also added another example to clarify the order of operands, and some edge cases like your example.
fixed
fixed
Fixed it. Thanks for the comment.
It should be both fixed. I have changed random tests so
Null
will not be expected so many times. Thanks for your comment.It should be fixed by now, thanks for the comment.