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

◆ pow_impl_double()

double fl::pow_impl_double ( double base,
double exponent )

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

338 {
339#if FL_MATH_USE_LIBM
340 return ::pow(base, exponent);
341#else
342 if (exponent == 0.0) return 1.0;
343 int ie = static_cast<int>(exponent);
344 if (static_cast<double>(ie) == exponent && ie >= -8 && ie <= 8) {
345 double r = 1.0;
346 if (ie > 0) { for (int i = 0; i < ie; ++i) r *= base; return r; }
347 if (ie < 0) { for (int i = 0; i < -ie; ++i) r *= base; return 1.0 / r; }
348 }
349 if (base <= 0.0) return 0.0;
350 return exp_impl_double(exponent * detail::log_natural_<double>(base));
351#endif
352}
F log_natural_(F value) FL_NOEXCEPT
Definition math.cpp.hpp:214
double exp_impl_double(double value)
Definition math.cpp.hpp:101

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

Referenced by pow().

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