Creating a Java Unit test vectoraddition
I made a java unit test (see comment) for a piece of code that adds two vectors of the same dimension but since v1 (in my test) isnt a double the test isnt working. Im confused as to what they did in the original and how to make the test
11 Replies
⌛
This post has been reserved for your question.
Hey @mjstx! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
how would i do that last part?
lika a short example
vektoraddition wants an array of doubles, not a
Vector
instanceah ok, so basically the array holds the values of the "vector". How did you discern thouth that they were talking about an array and not actualy vectors here? That still is a bit hazy to me
the method accepts 2 double arrays and returns a double array with the sum of both
double[] is the double array type
-> an array of doubles
int[] would be an array of ints
Ahh alright 👍 thanks!
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
Post Closed
This post has been closed by <@290070433984806912>.