MCPcopy Create free account
hub / github.com/devkitPro/3ds-hbmenu / randomFloat

Function randomFloat

source/ui/background.c:29–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29static float randomFloat(void)
30{
31 // Wichmann-Hill
32 static u16 s1 = 100, s2 = 100, s3 = 100;
33
34 s1 = (171 * s1) % 30269;
35 s2 = (172 * s2) % 30307;
36 s3 = (170 * s3) % 30323;
37
38 return floatFract(s1/30269.0f + s2/30307.0f + s3/30323.0f);
39}
40
41static float randomFloatInterval(float vmin, float vmax)
42{

Callers 2

randomFloatIntervalFunction · 0.85
backgroundInitFunction · 0.85

Calls 1

floatFractFunction · 0.85

Tested by

no test coverage detected