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

chuck 1.4.2 appears to have broken Spectacle and Multicomb (RNG) #58

Open
dbadb opened this issue Jan 8, 2023 · 1 comment
Open

chuck 1.4.2 appears to have broken Spectacle and Multicomb (RNG) #58

dbadb opened this issue Jan 8, 2023 · 1 comment

Comments

@dbadb
Copy link

dbadb commented Jan 8, 2023

chuck 1.4.2 appears to have broken Spectacle and Multicomb (RNG) by undefining RAND_MAX.

Seems like an opportunity to modernize and decouple. Both chugins want a rand2f function.
Here's a simple+modern+portable one.

#include <random>
float rand2f (float min, float max)
{
    static std::mt19937 s_mt;
    static std::uniform_real_distribution<float> s_dist(0.f, 1.f);
    float x = s_dist(s_mt);
    return min + x * (max - min);
}
@gewang
Copy link
Member

gewang commented May 16, 2023

looking into this (@celestebetancur @nshaheed @gewang) we believe this is indeed due to rand2f using both ::random() and CK_RANDOM_MAX; the latter is determined by platform and may be inconsistent with ::random(); we plan to fix this post chuck-1.5, where we have a number of chugin evolutions on the roadmap.

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

2 participants