You need to sign in or sign up before continuing.×
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.
You are right,I guess it was my own mistake.
Seems fine to me. Try saving your code and use the 'reset' button which should reset the tests.
Tests are messed up.
Traceback (most recent call last):
File "/workspace/default/.venv/lib/python3.11/site-packages/codewars_test/test_framework.py", line 112, in wrapper
func()
File "/workspace/default/tests.py", line 11, in test_case
2: (s, "fat"),
^
NameError: name 's' is not defined
Maybe 6 kyu. It took me some time to solve it.
That which you mention is not a Java bug.
Comparisons between primitive types do not produce the errors you mentioned, and the "equals" method
of Integer class compares whether they are the same object by comparing if are of the same class and their values.
Integer equals:
I've solved that problem. There was a precision issue in test case.
This might be a bug on java. Some times, when using equal on the numeric objects, instead comparing the value, they compare the instances memory addresses.
Java
Why sometimes (.2% de 100 of running test) fails?
I have compensated for an error of 1E-10.
sumHeight: 39.399476090834455 sumWidth: 39.399476090834455: perfect
org.opentest4j.AssertionFailedError:
Expected :fat
Actual :perfect
It's fixed now, if you encountered an issue, reopen this
Python
For what language this issue addressed? If Python, i can fix this.
A solution: don't generate (near) perfect matrices.
For example:
???
approved by
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.
Loading more items...