forked from icaven/glm
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Description
According to the API Documentation:
Generate random numbers in the interval [Min, Max], according a linear distribution
- Min Minimum value included in the sampling
- Max Maximum value included in the sampling
- genType Value type. Currently supported: float or double scalars.
#include<glm/gtc/random.hpp>
double observedMin = 1000.0;
double observedMax = -1000.0;
for (int i = 0; i < 1000000; i++) {
double rand = glm::linearRand(-1000.0, 1000.0);
observedMax = std::max(observedMax, rand);
observedMin = std::min(observedMin, rand);
}
printf("max=%.7f, min=%.7f", observedMax, observedMin);
Executing this (c++ 17, glm-1.0.1, msvc140) gives the following results which are not correct and do not match Documentation:
max=992.1559811, min=-999.9977357
Metadata
Metadata
Assignees
Labels
No labels