FastLED 3.9.15
Loading...
Searching...
No Matches
div_by_count.h
Go to the documentation of this file.
1#pragma once
2
3#include "fl/stl/int.h"
5
6namespace fl {
7namespace detail {
8
9template <typename T>
10inline typename fl::enable_if<fl::is_floating_point<T>::value, T>::type
11div_by_count(T sum, fl::size count) { return sum / static_cast<T>(count); }
12
13template <typename T>
15div_by_count(T sum, fl::size count) { return sum / static_cast<T>(count); }
16
17template <typename T>
20div_by_count(T sum, fl::size count) { return sum / T(static_cast<float>(count)); }
21
22} // namespace detail
23} // namespace fl
fl::enable_if< fl::is_floating_point< T >::value, T >::type div_by_count(T sum, fl::size count)
Compile-time linker keep-alive hook for a single fl::Bus.
Definition bus_traits.h:48
Base definition for an LED controller.
Definition crgb.hpp:179