diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-10-23 17:52:30 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-10-23 17:52:30 +0000 |
commit | 243a6be085fe6a7ce49169864c68a8839735e49b (patch) | |
tree | abfecf3c23dc7512ca48e72ac418b149c865e0f3 /include/random | |
parent | 1147845301c03308e3419b89c28c77bb6917fe04 (diff) |
Notes
Diffstat (limited to 'include/random')
-rw-r--r-- | include/random | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/random b/include/random index 9fefee081702..afa60b4af048 100644 --- a/include/random +++ b/include/random @@ -3645,7 +3645,7 @@ generate_canonical(_URNG& __g) const size_t __logR = __log2<uint64_t, _URNG::max() - _URNG::min() + uint64_t(1)>::value; #endif const size_t __k = __b / __logR + (__b % __logR != 0) + (__b == 0); - const _RealType _Rp = _URNG::max() - _URNG::min() + _RealType(1); + const _RealType _Rp = static_cast<_RealType>(_URNG::max() - _URNG::min()) + _RealType(1); _RealType __base = _Rp; _RealType _Sp = __g() - _URNG::min(); for (size_t __i = 1; __i < __k; ++__i, __base *= _Rp) |