Jump to content

Dot product: Difference between revisions

m
Line 3,441:
 
=={{header|V (Vlang)}}==
<syntaxhighlight lang="v (vlang)">fn dot(x []int, y []int) ?int {
fn dot(x []int, y []int) !int {
if x.len != y.len {
return error("incompatible lengths")
Line 3,453 ⟶ 3,454:
fn main() {
d := dot([1, 3, -5], [4, -2, -1])?!
 
println(d)
}
}</syntaxhighlight>
 
{{out}}
291

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.