Small fix.

This commit is contained in:
Relintai 2021-03-27 22:22:12 +01:00
parent a46bd28ad8
commit 6bc2c1fb45
2 changed files with 4 additions and 4 deletions

View File

@ -148,8 +148,8 @@ UML:
| + randomize() { static } | -> srand(time(NULL));
| |
| + rand() : int { static } | -> return rand();
| + randf() : float { static } | -> return rand() / RANDOM_32BIT_MAX;
| + randd() : float { static } | -> return rand() / RANDOM_32BIT_MAX;
| + randf() : float { static } | -> return rand() / static_cast<float>(RANDOM_32BIT_MAX);
| + randd() : double { static } | -> return rand() / static_cast<double>(RANDOM_32BIT_MAX);
| |
| + rand(int m) : int { static } | -> return rand() % m;
| |

View File

@ -48,11 +48,11 @@ int Math::rand() {
}
float Math::randf() {
return rand() / RANDOM_32BIT_MAX;
return rand() / static_cast<float>(RANDOM_32BIT_MAX);
}
double Math::randd() {
return rand() / RANDOM_32BIT_MAX;
return rand() / static_cast<double>(RANDOM_32BIT_MAX);
}
int rand(const int m) {