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.
It is specified in the description:
sol[0]
: the real part of the first numbersol[1]
: the coefficient of the imaginary part of the first number (expressed in terms of √-1, more commonly known as i)sol[2]
: the real part of the second number, must not be greater than sol[0]sol[3]
: the coefficient of the imaginary part of the second number, must not be greater than sol[1]Sorry, I'm not quite sure - does that mean percentage difference?
Sure, will fix this issue and the other one later today
Does it work now? I've done that type-cast, and reduced the range of
sum
andproduct
in the random tests."The first number" is the first solution (complex) whose real part is
sol[0]
and imaginary part issol[1]
. The second number is the first number subtracted from thesum
parameter of the function (Re =sol[2]
, Im =sol[3]
).They are relevant because they need to be returned to the caller as the only set of complex numbers (here, a
double[4]
) such that the sum and product of the first and second numbers are very close to the passed parameters. I hope this helps!This comment is hidden because it contains spoiler information about the solution
The more you know about obscure inline ASM hacks... :D
Oh okay, thanks! Is there anything else that needs to be fixed?
Fixed both - is it safe to use
memcpy()
like this, though?Sure, you can approve it, it looks good to me!
Oh, OK - thanks a lot for explaining, I'll do my best to remember that!
I've unpublished my fork, I agree it wasn't anything unique...
Hi,
I do want to make a NASM translation - sorry if I caused a mess by publishing my fork, will be more careful about this next time!
So if I understood correctly, I can approve the version that I think is better without the author having to review it?
NASM translation, please review :)