# Random number in (0,1)

**URL:** <https://discourse.julialang.org/t/random-number-in-0-1/51451>\
**Category:** Statistics\
**Created:** [December 8, 2020, 11:33am UTC](https://discourse.julialang.org/t/random-number-in-0-1/51451 "2020-12-08T11:33:25Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [December 8, 2020, 12:17pm UTC](https://discourse.julialang.org/t/random-number-in-0-1/51451/3 "2020-12-08T12:17:48Z")

</div>

There is a solution by @Elrod [here](https://discourse.julialang.org/t/how-to-create-a-random-uniform-distribution-between-but-excluding-0-and-10/21908/20) to get the random numbers distribution over (0,1):

```julia
prevfloat(1.0)*(1-rand())

```

---

_[View the full topic](https://discourse.julialang.org/t/random-number-in-0-1/51451)._
