The vector is displayed at 0.000000001f, so the test does not work.
Following the logic in my head, Yeilds -1.0f, -1.0f, but when I wrote the code to pass the test (using the built-in vector methods), the response returns as -0.999999999f, -0.999999999f, which is still 'right'.
This is C # (the Vector2 class provided by the XNA framework), by the way, so I tried to add an epsilon value for each parameter x and y of the vector, but that didn't work.
I see that, when coding an answer, I am writing production code. For instance. that would be the same. Of course, this is wrong.
Any tips?
source share