MCPcopy Create free account
hub / github.com/LUX-Core/lux / getSmallPositiveFloatBits

Function getSmallPositiveFloatBits

src/crypto/RandomX/virtual_machine.cpp:49–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47namespace randomx {
48
49 static inline uint64_t getSmallPositiveFloatBits(uint64_t entropy) {
50 auto exponent = entropy >> 59; //0..31
51 auto mantissa = entropy & mantissaMask;
52 exponent += exponentBias;
53 exponent &= exponentMask;
54 exponent <<= mantissaSize;
55 return exponent | mantissa;
56 }
57
58 static inline uint64_t getStaticExponent(uint64_t entropy) {
59 auto exponent = constExponentBits;

Callers 1

initializeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected