# Range for core function rand()

**URL:** <https://discourse.julialang.org/t/range-for-core-function-rand/7685>\
**Category:** Statistics\
**Created:** [December 10, 2017, 9:59pm UTC](https://discourse.julialang.org/t/range-for-core-function-rand/7685 "2017-12-10T21:59:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zlon](https://avatars.discourse-cdn.com/v4/letter/z/b487fb/32.png) [@zlon](https://discourse.julialang.org/u/zlon)\
**Post date:** [December 10, 2017, 9:59pm UTC](https://discourse.julialang.org/t/range-for-core-function-rand/7685/1 "2017-12-10T21:59:30Z")

</div>

I couldn’t find it in docs. If  
X=rand(), then  
X comes from [0 1] or [0 1) or some other variance?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [December 10, 2017, 10:01pm UTC](https://discourse.julialang.org/t/range-for-core-function-rand/7685/2 "2017-12-10T22:01:23Z")

</div>

```julia
help?> rand
search: rand randn rand! randn! randexp randperm randjump randexp! randcycle randsubseq randstring randsubseq! RandomDevice srand sprand sprandn bitrand transcode readandwrite RangeIndex macroexpand @macroexpand rsearchindex

  rand([rng=GLOBAL_RNG], [S], [dims...])

  Pick a random element or array of random elements from the set of values specified by S; S can be

    • an indexable collection (for example 1:n or ['x','y','z']), or

    • a type: the set of values to pick from is then equivalent to typemin(S):typemax(S) for integers (this is not applicable to BigInt), and to [0, 1) for floating point numbers;

  S defaults to Float64.

```

Note: “to `[0, 1)` for floating point numbers”
