mirror of
https://github.com/Relintai/programming_tutorials.git
synced 2025-04-21 21:51:22 +02:00
Small fix.
This commit is contained in:
parent
a46bd28ad8
commit
6bc2c1fb45
@ -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;
|
||||
| |
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user