# REPL arithmetic gives wrong result on first run

**URL:** <https://discourse.julialang.org/t/repl-arithmetic-gives-wrong-result-on-first-run/11274>\
**Category:** General Usage\
**Created:** [May 30, 2018, 8:07pm UTC](https://discourse.julialang.org/t/repl-arithmetic-gives-wrong-result-on-first-run/11274 "2018-05-30T20:07:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kimran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kimran/32/7782_2.png) [@kimran](https://discourse.julialang.org/u/kimran)\
**Post date:** [May 30, 2018, 8:07pm UTC](https://discourse.julialang.org/t/repl-arithmetic-gives-wrong-result-on-first-run/11274/1 "2018-05-30T20:07:55Z")

</div>

REPL gives 2 different results for simple arithmetic calculation

 ![53](https://global.discourse-cdn.com/julialang/original/3X/3/b/3b3d483c0617a85a1abb14b248cf4f0f18cf255d.png)

Gives came after running a bunch of complex, quantitative code  
I have not replicated it, nor tried due to lack of time

So this is just to put out there that something is not 100%

Not even sure whether its julia or Atom or Juno or what

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [May 30, 2018, 8:21pm UTC](https://discourse.julialang.org/t/repl-arithmetic-gives-wrong-result-on-first-run/11274/2 "2018-05-30T20:21:14Z")

</div>

There’s really not much we can do with this. Without any clue as to what you were doing before or how to reproduce, this could be a bug in just about anything, or even something like some subtle type piracy in a library you’re using.

Can you give any detail? Or find any reproduction? Otherwise I might as well just assume your RAM was hit by a stray cosmic ray.

Also, [please post code as text, not as a screenshot](https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-on-so-when-asking-a-question/285557#285557).

---

<div class="post-metadata">

**Author:** ![kimran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kimran/32/7782_2.png) [@kimran](https://discourse.julialang.org/u/kimran)\
**Post date:** [May 30, 2018, 8:36pm UTC](https://discourse.julialang.org/t/repl-arithmetic-gives-wrong-result-on-first-run/11274/3 "2018-05-30T20:36:47Z")

</div>

Yes, I realise its pretty useless without a reproduction  
I thought I would still submit in case anyone else ever runs into something like this and perhaps gives another clue  
If I get it again, I will add info

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [May 30, 2018, 8:45pm UTC](https://discourse.julialang.org/t/repl-arithmetic-gives-wrong-result-on-first-run/11274/4 "2018-05-30T20:45:03Z")

</div>

I will certainly keep an eye out myself 🙂

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [May 30, 2018, 8:45pm UTC](https://discourse.julialang.org/t/repl-arithmetic-gives-wrong-result-on-first-run/11274/5 "2018-05-30T20:45:46Z")

</div>

I’m seem to recall some Juno/Atom bug along these lines being reported previously.

---

<div class="post-metadata">

**Author:** ![ssfrr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ssfrr/32/3736_2.png) [@ssfrr](https://discourse.julialang.org/u/ssfrr)\
**Post date:** [May 30, 2018, 8:47pm UTC](https://discourse.julialang.org/t/repl-arithmetic-gives-wrong-result-on-first-run/11274/6 "2018-05-30T20:47:32Z")

</div>

I’ve seen some similar strangeness (expressions that should be deterministic returning different results when run back-to-back), but also have never been able to come up with a repro. It’s only been when running from with Atom, but I also usually run within Atom, so I can’t say it wouldn’t happen at a bare REPL.

I thought I filed an issue with `atom-julia-client` at some point, but maybe not. Here are a couple issues I filed with FixedPointNumbers, which was the package I was hacking on when this was happening to me before:

[https://github.com/JuliaMath/FixedPointNumbers.jl/issues/103](https://github.com/JuliaMath/FixedPointNumbers.jl/issues/103)  
[https://github.com/JuliaMath/FixedPointNumbers.jl/issues/104](https://github.com/JuliaMath/FixedPointNumbers.jl/issues/104)

There was also a discussion on Slack a while ago where it happened to someone else.

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [May 30, 2018, 9:26pm UTC](https://discourse.julialang.org/t/repl-arithmetic-gives-wrong-result-on-first-run/11274/7 "2018-05-30T21:26:33Z")

</div>

[https://github.com/JunoLab/Juno.jl/issues/119](https://github.com/JunoLab/Juno.jl/issues/119)

If you update to a somewhat recent version of Atom.jl (current is 0.6.14) that should not happen any more.
