#1708 Fishbones: Fix issue with random angle on Linux

This commit is contained in:
Magne Sjaastad
2017-09-08 08:21:44 +02:00
parent 33e94c447b
commit cb7a5253ff

View File

@@ -716,13 +716,9 @@ int RimFishbonesMultipleSubs::randomValueFromRange(int min, int max)
// See http://www.cplusplus.com/reference/cstdlib/rand/
int range = abs(max - min);
int random_integer = min + int(range*rand() / (RAND_MAX + 1.0));
return random_integer;
int randomNumberInRange = rand() % range;
int randomValue = min + randomNumberInRange;
return randomValue;
}