Skip to content
Snippets Groups Projects
Commit 4685228f authored by scott snyder's avatar scott snyder Committed by scott snyder
Browse files

TestTools: Fix clang 10 warning.

Use explict cast for int->float conversion that loses precision.
parent 0196c8db
No related branches found
No related tags found
No related merge requests found
// This file's extension implies that it's C, but it's really -*- C++ -*-.
/*
* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
* Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
*/
/**
* @file TestTools/random.h
......@@ -52,7 +52,7 @@ uint32_t rng_seed (uint32_t& seed)
inline
float randf_seed (uint32_t& seed, float rmax, float rmin = 0)
{
return static_cast<float>(rng_seed(seed)) / rngmax * (rmax-rmin) + rmin;
return static_cast<float>(rng_seed(seed)) / static_cast<float>(rngmax) * (rmax-rmin) + rmin;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment