# Different inner product if vector type is not set

**URL:** <https://discourse.julialang.org/t/different-inner-product-if-vector-type-is-not-set/35359>\
**Category:** General Usage\
**Tags:** question\
**Created:** [March 1, 2020, 1:48pm UTC](https://discourse.julialang.org/t/different-inner-product-if-vector-type-is-not-set/35359 "2020-03-01T13:48:00Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![abraunst](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abraunst/32/6880_2.png) [@abraunst](https://discourse.julialang.org/u/abraunst)\
**Post date:** [March 1, 2020, 8:22pm UTC](https://discourse.julialang.org/t/different-inner-product-if-vector-type-is-not-set/35359/8 "2020-03-01T20:22:21Z")

</div>

I think you do, but you may be surprised to know that floating point addition is not associative (due to, essentially, rounding).

```julia
julia> @show (-1e30+1e30)+1.0 -1e30+(1e30+1.0);
(-1.0e30 + 1.0e30) + 1.0 = 1.0
-1.0e30 + (1.0e30 + 1.0) = 0.0

```

---

_[View the full topic](https://discourse.julialang.org/t/different-inner-product-if-vector-type-is-not-set/35359)._
