#include "Random.hpp" namespace Math::Random { std::array break_float(const F32 f) { union { F32 f; U8 u[4]; } t{}; t.f = f; return { t.u[0], t.u[1], t.u[2], t.u[3] }; } F32 to_float(U8 u) { return (F32)u / (F32)255; } U8 hash(U8 x) { auto o = (x ^ 0xAA) * 5; auto rot = o % 8; return o << rot | o >> (8 - rot); } Real random() { U8 r = std::rand() % 255; return to_float(hash(r)); } }