# Why does Random.seed!() return different results in Atom and VSCode?

**URL:** <https://discourse.julialang.org/t/why-does-random-seed-return-different-results-in-atom-and-vscode/84287>\
**Category:** VS Code\
**Created:** [July 15, 2022, 7:22pm UTC](https://discourse.julialang.org/t/why-does-random-seed-return-different-results-in-atom-and-vscode/84287 "2022-07-15T19:22:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![etorkia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/etorkia/32/11677_2.png) [@etorkia](https://discourse.julialang.org/u/etorkia)\
**Post date:** [July 15, 2022, 7:22pm UTC](https://discourse.julialang.org/t/why-does-random-seed-return-different-results-in-atom-and-vscode/84287/1 "2022-07-15T19:22:24Z")

</div>

I am trying to run Documenter.jl and the output results are different that the expected results due to a difference in sampling. I can reproduce a seeded result using 1 in both cases but different outputs! Any thoughts?

---

<div class="post-metadata">

**Author:** ![bernhard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bernhard/32/2619_2.png) [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Post date:** [July 15, 2022, 8:07pm UTC](https://discourse.julialang.org/t/why-does-random-seed-return-different-results-in-atom-and-vscode/84287/2 "2022-07-15T20:07:50Z")

</div>

Why don’t you provide a seed argument to seed!()?  
The documentation seems to suggest this [https://docs.julialang.org/en/v1/stdlib/Random/#Random.seed!](https://docs.julialang.org/en/v1/stdlib/Random/#Random.seed!)

_Reseed the random number generator: `rng` will give a reproducible sequence of numbers if and only if a `seed` is provided._

---

<div class="post-metadata">

**Author:** ![etorkia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/etorkia/32/11677_2.png) [@etorkia](https://discourse.julialang.org/u/etorkia)\
**Post date:** [July 19, 2022, 5:20pm UTC](https://discourse.julialang.org/t/why-does-random-seed-return-different-results-in-atom-and-vscode/84287/3 "2022-07-19T17:20:09Z")

</div>

Thanks! I generated the error using Random.seed!(1) and rand(2) to test. The actual issue is that the seed does not produce the same sequence in version 1.6.5 and version 1.7.1. What I had not realized is that both Atom and VSCode were on different releases. I know ther were some changes mad to move to Xoshiro 256+++ but I set is to Mersenne Twister for both tests. Really weird, no?

---

<div class="post-metadata">

**Author:** ![bernhard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bernhard/32/2619_2.png) [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Post date:** [July 19, 2022, 6:18pm UTC](https://discourse.julialang.org/t/why-does-random-seed-return-different-results-in-atom-and-vscode/84287/4 "2022-07-19T18:18:48Z")

</div>

Vscode is not on any release. you either have julia in your path or it is specified in the vscode settings.  
You may want to consider [GitHub - JuliaRandom/StableRNGs.jl: A Julia RNG with stable streams](https://github.com/JuliaRandom/StableRNGs.jl)
