# How to create a random Uniform Distribution between (but excluding) 0 and 10?

**URL:** <https://discourse.julialang.org/t/how-to-create-a-random-uniform-distribution-between-but-excluding-0-and-10/21908>\
**Category:** New to Julia\
**Created:** [March 15, 2019, 10:54am UTC](https://discourse.julialang.org/t/how-to-create-a-random-uniform-distribution-between-but-excluding-0-and-10/21908 "2019-03-15T10:54:42Z")\
**Posts on this page:** 1\
**Page:** 2

<div class="post-metadata">

**Author:** ![foobar\_lv2](https://avatars.discourse-cdn.com/v4/letter/f/ee59a6/32.png) [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Post date:** [March 17, 2019, 11:31am UTC](https://discourse.julialang.org/t/how-to-create-a-random-uniform-distribution-between-but-excluding-0-and-10/21908/22 "2019-03-17T11:31:45Z")

</div>

> [@StefanKarpinski](#):
>
> Just to try to prevent this thread being overwhelming for a newcomer,

I apologize for the derail. I hope it is at least interesting 🙂

> [@Elrod](#):
>
> I imagine this would also be computationally expensive to do with only 32 bits, or.

I would take `trailing_zeros(u)` as exponent (that is exponentially distributed, as required), shift right by 9 bit and fill in the sign and exponent.

[Previous page](https://discourse.julialang.org/t/how-to-create-a-random-uniform-distribution-between-but-excluding-0-and-10/21908.md?page=1)
