# Dot product and norm for arrays of arrays

**URL:** <https://discourse.julialang.org/t/dot-product-and-norm-for-arrays-of-arrays/1990>\
**Category:** General Usage\
**Created:** [February 8, 2017, 8:43pm UTC](https://discourse.julialang.org/t/dot-product-and-norm-for-arrays-of-arrays/1990 "2017-02-08T20:43:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lostella](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lostella/32/356_2.png) [@lostella](https://discourse.julialang.org/u/lostella)\
**Post date:** [February 8, 2017, 8:43pm UTC](https://discourse.julialang.org/t/dot-product-and-norm-for-arrays-of-arrays/1990/1 "2017-02-08T20:43:27Z")

</div>

Hi all,

I just realized that one can use `dot` and `norm` (and `vecdot` and `vecnorm`) on objects of type `Array{Array{T, N}, 1}`. However, their behaviour it’s not clear to me, and I would like to know whether it’s the intended one. For example, in Julia 0.6:

```julia
x = [[1.0 2.0 3.0; 4.0 5.0 6.0], [1.0 2.0 3.0]];
norm(x) # = 10.217762598840018
# which one may think is equivalent to
sqrt(dot(x,x)) # = 10.246950765959598, so no
# and in fact
sqrt(norm(x[1])^2+norm(x[2])^2) == norm(x) # = true

```

So, apparently `norm` is broadcasted to the two elements of the array, resulting in a matrix norm for the first element, and a vector norm for the second. The two results are then `norm`-ed. So maybe:

```julia
vecnorm(x) == sqrt(dot(x,x)) # = false. What?
vecnorm(x) # = 10.217762598840018, like norm(x)

```

Is any of this behaviour explained in the documentation?
