Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random float problem in some compiler or platform #37

Open
WeebOwO opened this issue Jan 31, 2023 · 0 comments
Open

Random float problem in some compiler or platform #37

WeebOwO opened this issue Jan 31, 2023 · 0 comments

Comments

@WeebOwO
Copy link

WeebOwO commented Jan 31, 2023

1. Describe the bug

In some compiler or platform, std::mt19937::result_type will not be unsigned int, this will cause Float() not in 0~1 range.
https://github.com/TheCherno/Walnut/blob/3b8e414fdecfc6c8b58816106fe8d912bd172e31/Walnut/src/Walnut/Random.h#L48

图片

图片

2. Desktop

  • Os: Ubuntu 22.04
  • Compiler: Gcc 11.3
  • Cpu: Ryzen™ 5 4600G

3. My fix solution

explicit declare type like below

 static std::uniform_int_distribution<uint32_t> s_Distribution; 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant