| 47 | namespace 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; |