MCPcopy Create free account
hub / github.com/FastLED/FastLED / float_bits_magnitude_exceeds_2_24

Function float_bits_magnitude_exceeds_2_24

src/fl/stl/json.cpp.hpp:56–61  ·  view source on GitHub ↗

Returns true iff `bits` represents a finite IEEE-754 single-precision value whose magnitude exceeds 2**24 (the float-integer-precision boundary). Used to decide whether an array of numbers can survive packing into `fl::vector ` without integer-precision loss. Integer-only -- operates on the bit pattern. Math: |value| > 2**24 iff biased_exp > 151 (exponent >= 25, m

Source from the content-addressed store, hash-verified

54// is taken -- matches the previous `canBeRepresentedAsFloat(double)` semantics
55// before this code was bit-twiddled (FastLED #3022 phase 2).
56static inline bool float_bits_magnitude_exceeds_2_24(u32 bits) FL_NOEXCEPT {
57 const u32 biased_exp = (bits >> 23) & 0xFFu;
58 const u32 mantissa = bits & 0x7FFFFFu;
59 return biased_exp == 0xFFu || biased_exp > 151u ||
60 (biased_exp == 151u && mantissa != 0u);
61}
62
63
64json_value& get_null_json_value() {

Callers 2

scan_array_lookaheadMethod · 0.85
classify_arrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected