FastLED 3.9.15
Loading...
Searching...
No Matches

◆ FL_DISABLE_WARNING() [2/3]

FL_DISABLE_WARNING_PUSH fl::FL_DISABLE_WARNING ( float- equal)

Definition at line 135 of file math.h.

142 {
143
144// Primary template for map_range_math
145template <typename T, typename U> struct map_range_math {
146 static U map(T value, T in_min, T in_max, U out_min, U out_max) FL_NOEXCEPT {
147 if (in_min == in_max)
148 return out_min;
149 return out_min +
150 (value - in_min) * (out_max - out_min) / (in_max - in_min);
151 }
152};
153
154// Specialization for u8 -> u8
155template <> struct map_range_math<u8, u8> {
156 static u8 map(u8 value, u8 in_min, u8 in_max,
157 u8 out_min, u8 out_max) FL_NOEXCEPT;
158};
159
160// Specialization for u16 -> u16
161template <> struct map_range_math<u16, u16> {
162 static u16 map(u16 value, u16 in_min, u16 in_max,
163 u16 out_min, u16 out_max) FL_NOEXCEPT;
164};
165
166// Equality comparison helpers
167template <typename T> bool equals(T a, T b) FL_NOEXCEPT { return a == b; }
168inline bool equals(float a, float b) FL_NOEXCEPT { return fl::almost_equal(a, b); }
169inline bool equals(double d, double d2) FL_NOEXCEPT { return fl::almost_equal(d, d2); }
170
171} // namespace map_range_detail
unsigned char u8
Definition stdint.h:131
unsigned char u8
Definition stdint.h:131
constexpr int type_rank< T >::value
MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > > map
Definition map.h:283
constexpr bool almost_equal(T a, T b, U tolerance) FL_NOEXCEPT
Definition math.h:90
#define FL_NOEXCEPT

References almost_equal(), equal(), FL_DISABLE_WARNING_FLOAT_CONVERSION, FL_DISABLE_WARNING_IMPLICIT_INT_CONVERSION, FL_DISABLE_WARNING_SIGN_CONVERSION, FL_NOEXCEPT, and type_rank< T >::value.

+ Here is the call graph for this function: