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

◆ pow_impl_float()

float fl::pow_impl_float ( float base,
float exponent )

Definition at line 322 of file math.cpp.hpp.

322 {
323#if FL_MATH_USE_LIBM
324 return ::powf(base, exponent);
325#else
326 if (exponent == 0.0f) return 1.0f;
327 int ie = static_cast<int>(exponent);
328 if (static_cast<float>(ie) == exponent && ie >= -8 && ie <= 8) {
329 float r = 1.0f;
330 if (ie > 0) { for (int i = 0; i < ie; ++i) r *= base; return r; }
331 if (ie < 0) { for (int i = 0; i < -ie; ++i) r *= base; return 1.0f / r; }
332 }
333 if (base <= 0.0f) return 0.0f;
334 return exp_impl_float(exponent * detail::log_natural_<float>(base));
335#endif
336}
F log_natural_(F value) FL_NOEXCEPT
Definition math.cpp.hpp:214
float exp_impl_float(float value)
Definition math.cpp.hpp:80

References exp_impl_float(), and fl::detail::log_natural_().

Referenced by pow(), and powf().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: