# Nightly build CI failing because rand(UnitRange) changed (when to care?)

**URL:** <https://discourse.julialang.org/t/nightly-build-ci-failing-because-rand-unitrange-changed-when-to-care/49857>\
**Category:** New to Julia\
**Created:** [November 9, 2020, 5:35pm UTC](https://discourse.julialang.org/t/nightly-build-ci-failing-because-rand-unitrange-changed-when-to-care/49857 "2020-11-09T17:35:28Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [November 10, 2020, 10:42am UTC](https://discourse.julialang.org/t/nightly-build-ci-failing-because-rand-unitrange-changed-when-to-care/49857/15 "2020-11-10T10:42:07Z")

</div>

> [@rfourquet](#):
>
> It sounds like you suggest to save the random inputs, not the calculation from the random inputs…

To be specific, I am suggesting that something like

```julia
function f(rng, x)
    y = rand(rng)
    # ... some complex calculation involving x and y
end

```

is refactored to

```julia
function some_complex_calculation(x, y)
    ...
end

```

which is deterministic and can be tested as such.

> [@rfourquet](#):
>
> would you mind expanding a bit on this?

Eg topics like

> [@Different Float64 sum on different architectures](https://discourse.julialang.org/t/different-float64-sum-on-different-architectures/46949/):
>
> I sometimes get different results for summing a vector of Float64 numbers on different Windows machines. The vectors are identical, so it seems sum can produce different results across hardware architectures (even if os is always Windows). Is this expected? Is there a way to guarantee the same results? Would sum\_kbn from KahanSummation, or xsum from Xsum guarantee the same result? Both of these alternative sums produce identical results across machines on my particular data. [https://github…](https://github.com/JuliaMath/KahanSummation.jl)

The issue is nearly impossible to avoid for reasonably complex calculations.

---

_[View the full topic](https://discourse.julialang.org/t/nightly-build-ci-failing-because-rand-unitrange-changed-when-to-care/49857)._
