From 9d6c1a49791840a7287972827a11206d3b9fbc97 Mon Sep 17 00:00:00 2001 From: Niklas Schmitz Date: Wed, 23 Oct 2024 17:41:45 +0200 Subject: [PATCH] Fix float type of radial rand() --- src/utils.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.jl b/src/utils.jl index 5552453..53ca5e7 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -117,7 +117,7 @@ function rattle!(at::FlexibleSystem, r::Quantity) 𝐫ᵢ = p.position T = typeof(ustrip(𝐫ᵢ[1])) ui = randn(Vec3{T}) - p_new = _set_position(p, 𝐫ᵢ + rand() * r * ui / norm(ui)) + p_new = _set_position(p, 𝐫ᵢ + rand(T) * r * ui / norm(ui)) at.particles[i] = p_new end return at