FastLED 3.10.8
Loading...
Searching...
No Matches

◆ round_shift_right_u64()

u32 fl::detail::round_shift_right_u64 ( u64 value,
int shift )
inline

Definition at line 144 of file json.h.

144 : fl::true_type {};
145
146inline u32 round_shift_right_u64(u64 value, int shift) FL_NO_EXCEPT {
147 if (shift <= 0) {
148 return static_cast<u32>(value);
149 }
150 if (shift >= 64) {
151 return 0;
152 }
153 const u64 half = u64(1) << (shift - 1);
154 const u64 mask = (u64(1) << shift) - 1;
155 const u64 truncated = value >> shift;
156 const u64 remainder = value & mask;
157 const bool round_up = remainder > half || (remainder == half && (truncated & 1));
u32 round_shift_right_u64(u64 value, int shift) FL_NO_EXCEPT
Definition json.h:144
u8 u8 fract8 blur_amount FL_NO_EXCEPT
Definition blur.h:186
constexpr int type_rank< T >::value
integral_constant< bool, true > true_type
Definition type_traits.h:28
fl::u64 u64
Definition stdint.h:220