January 2020
Intermediate to advanced
532 pages
13h 31m
English
The first option is what we started with at the beginning of this section. It has the most specific types of arguments. The drawback is that it can only work with a vector of Float64 values.
Let's define our function as follows so that we can pass it to the testing function:
sumprod_1(A::Vector{Float64}, B::Vector{Float64}) = sum(A .* B)
We can try our test harness now:

As expected, this function can work with the first scenario when both arguments are vectors of Float64 values. So it does not satisfy all of our requirements. Let's try the next option.
Read now
Unlock full access