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.
Do not test that the returned values are close to the expected values (it is not clear which number is first and which is second). Suppose that the user function returns 2 complex numbers
a
andb
. Then the tests should check thata + b
is close tosum
anda * b
is close toproduct
. I also recommend to use relative errors when checking that two floating-point numbers are close.Do not ask to return a dynamically allocated array with a fixed number of elements. It is better to return a struct with 4 fields (but for this task it is much better to use complex numbers directly):