# Output distribution of rand(Float32) and rand(Float64), thread 2

**URL:** https://discourse.julialang.org/t/output-distribution-of-rand-float32-and-rand-float64-thread-2/105184
**Category:** Internals & Design
**Tags:** float, random
**Created:** [October 19, 2023, 1:10pm UTC](https://discourse.julialang.org/t/output-distribution-of-rand-float32-and-rand-float64-thread-2/105184 "2023-10-19T13:10:07Z")
**Posts on this page:** 1
**Showing post:** 12

<div class="post-metadata">

### Author: ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)
#### Post date: [October 19, 2023, 3:41pm UTC](https://discourse.julialang.org/t/output-distribution-of-rand-float32-and-rand-float64-thread-2/105184/12 "2023-10-19T15:41:46Z")

</div>

I mean, it’s all a matter of tradeoffs. As I see it, there are really three key questions that’d need to be considered:

- Is it breaking? It changes the interval from closed-open to open-open, and it’s a change in the documented behaviors. We have said, though, that changing RNG results is ok. It’s worth reviewing the time we looked into unbiasing `rand()` by making _just_ the change from half-open to open: [make rand unbiased for floats #33222](https://github.com/JuliaLang/julia/issues/33222). My read there is that _maybe_ but the weighting of tradeoffs in that change (which is different than this) weren’t worth it.
- Complexity and correctness. It’s quite clear what the distribution of `(0:2^53-1) ./ 2^53` looks like, flaws and all — and there’s additionally very well-established literature and norms in other languages. Apparently zig didn’t _quite_ get its newfangled implementation right: [Oh, cute. It looks like they ever-so-slightly overweight the probability of valu... | Hacker News](https://news.ycombinator.com/item?id=37934946).
- Performance.

---

_[View the full topic](https://discourse.julialang.org/t/output-distribution-of-rand-float32-and-rand-float64-thread-2/105184)._
