# Rand() period

**URL:** <https://discourse.julialang.org/t/rand-period/44837>\
**Category:** Modelling & Simulations\
**Tags:** question\
**Created:** [August 13, 2020, 12:29am UTC](https://discourse.julialang.org/t/rand-period/44837 "2020-08-13T00:29:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve1313](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@steve1313](https://discourse.julialang.org/u/steve1313)\
**Post date:** [August 13, 2020, 12:29am UTC](https://discourse.julialang.org/t/rand-period/44837/1 "2020-08-13T00:29:31Z")

</div>

What is the period of Julia’s rand() function (default rand(), returning Float64)?

How many times can you call rand() before it starts repeating?

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [August 13, 2020, 12:50am UTC](https://discourse.julialang.org/t/rand-period/44837/2 "2020-08-13T00:50:15Z")

</div>

Currently Julia uses the [Mersenne twister](https://en.wikipedia.org/wiki/Mersenne_Twister) generator. It has a period of 2^19937 - 1. In other words it will never repeat.
