# Large numbers multiplication

**URL:** https://discourse.julialang.org/t/large-numbers-multiplication/116574
**Category:** New to Julia
**Tags:** question
**Created:** [July 3, 2024, 8:48am UTC](https://discourse.julialang.org/t/large-numbers-multiplication/116574 "2024-07-03T08:48:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Sahil\_Khan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sahil_khan/32/47573_2.png) [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)
#### Post date: [July 3, 2024, 8:48am UTC](https://discourse.julialang.org/t/large-numbers-multiplication/116574/1 "2024-07-03T08:48:15Z")

</div>

Hello everyone,

Im doing some concentration conversion and I noticed this issue.

```julia
julia> 3.321155762205247e-10 * 6.022e23 * 0.5e-3 * 1e-6
100000.0

```

now if I put last three numbers in a variable.

```julia
x = 6.022e23 * 0.5e-3 * 1e-6

```

and Then multiply

```julia
julia> 3.321155762205247e-10 * x
99999.99999999999

```

Can someone tell me whats going on ? Like I know its almost same thing but I’m curious why?

Thank you 🙂

---

<div class="post-metadata">

### Author: ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)
#### Post date: [July 3, 2024, 8:55am UTC](https://discourse.julialang.org/t/large-numbers-multiplication/116574/2 "2024-07-03T08:55:55Z")

</div>

```julia
julia> 3.321155762205247e-10 * 6.022e23 * 0.5e-3 * 1e-6
100000.0

julia> 3.321155762205247e-10 * ( 6.022e23 * 0.5e-3 * 1e-6 )
99999.99999999999

```

It’s about floating point numbers and how they are represented in binary machines.  
Last time we had this was here: [Mismatch between nextfloat(0.0) and eps(Float64)](https://discourse.julialang.org/t/mismatch-between-nextfloat-0-0-and-eps-float64/115104)

---

<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: [July 3, 2024, 2:01pm UTC](https://discourse.julialang.org/t/large-numbers-multiplication/116574/3 "2024-07-03T14:01:05Z")

</div>

In particular, because every floating-point operation potentially incurs a rounding operation (to the closest representable number), floating-point operations like multiplication and addition are **not associative**.

This is true in every programming language, not just Julia; it’s intrinsic to fp arithmetic.
