9#if !defined(__has_include)
10#define FASTLED_HAS_EXP 0
12#if __has_include(<cmath>)
13#define FASTLED_HAS_EXP 1
15#elif __has_include(<math.h>)
16#define FASTLED_HAS_EXP 1
19#define FASTLED_HAS_EXP 0
32template <
typename T>
inline T
floor(T value) {
34 return static_cast<T
>(
static_cast<int>(value));
36 return static_cast<T
>(
::floor(
static_cast<float>(value)));
39template <
typename T>
inline T
ceil(T value) {
41 return static_cast<T
>(
static_cast<int>(value));
43 return static_cast<T
>(
::ceil(
static_cast<float>(value)));
47template <
typename T>
inline T
exp(T value) {
48#if defined(FASTLED_HAS_EXP)
49 return static_cast<T
>(
::exp(
static_cast<double>(value)));
54 double x =
static_cast<double>(value);
56 return static_cast<T
>(22026.465794806718);
58 return static_cast<T
>(0.0000453999297625);
62 for (
int i = 1; i < 10; ++i) {
66 return static_cast<T
>(
result);
73 return static_cast<int>((value >
static_cast<float>(
static_cast<int>(value)))
74 ?
static_cast<int>(value) + 1
75 :
static_cast<int>(value));
Result type for promise operations.
constexpr int ceil_constexpr(float value)