# Operation does not match

**URL:** <https://discourse.julialang.org/t/operation-does-not-match/111210>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [March 5, 2024, 5:25pm UTC](https://discourse.julialang.org/t/operation-does-not-match/111210 "2024-03-05T17:25:52Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [March 5, 2024, 7:30pm UTC](https://discourse.julialang.org/t/operation-does-not-match/111210/3 "2024-03-05T19:30:45Z")

</div>

Yes, it’s just roundoff errors. Because floating-point arithmetic may accumulate roundoff errors on every operation, it doesn’t follow the ordinary rules of algebra exactly in general. For example, it isn’t associative:

```julia
julia> (5 * 1) / 3
1.6666666666666667

julia> 5 * (1/3)
1.6666666666666665

```

This is isn’t specific to Julia, but has to do with how computers do arithmetic: see [PSA: floating-point arithmetic](https://discourse.julialang.org/t/psa-floating-point-arithmetic/8678)

PS. I reformatted your post to quote your code to make it easier to read. In the future, see [PSA: how to quote code with backticks](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530)

---

_[View the full topic](https://discourse.julialang.org/t/operation-does-not-match/111210)._
