From: Luca Heltai Date: Thu, 23 Nov 2017 08:01:16 +0000 (+0100) Subject: Be more pedantic with static_cast (now works also for std::complex). X-Git-Tag: v9.0.0-rc1~739^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5509%2Fhead;p=dealii.git Be more pedantic with static_cast (now works also for std::complex). --- diff --git a/tests/tests.h b/tests/tests.h index 80db3b4a65..84da785348 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -191,9 +191,10 @@ namespace Testing // Get a uniformly distributed random value between min and max template -T random_value(const T &min=0, const T &max=1) +T random_value(const T &min=static_cast(0), + const T &max=static_cast(1)) { - return min+(max-min)*(Testing::rand()/static_cast(RAND_MAX)); + return min+(max-min)*(static_cast(Testing::rand())/static_cast(RAND_MAX)); }