mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-07 09:48:04 +01:00
#2823: error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648
This commit is contained in:
parent
8bfeb52018
commit
a032f771af
@ -149,13 +149,13 @@ inline bool Random::nextBool()
|
|||||||
|
|
||||||
inline float Random::nextFloat()
|
inline float Random::nextFloat()
|
||||||
{
|
{
|
||||||
return float(next()) / 0x7FFFFFFF;
|
return static_cast<float>(nextDouble());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline double Random::nextDouble()
|
inline double Random::nextDouble()
|
||||||
{
|
{
|
||||||
return double(next()) / 0x7FFFFFFF;
|
return static_cast<double>(next()) / static_cast<double>(0x7FFFFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user