FastLED 3.10.8
Loading...
Searching...
No Matches

◆ pow_impl_double()

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

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

420 {
421#if FL_MATH_USE_LIBM
422 return ::pow(base, exponent);
423#else
424 if (exponent == 0.0) return 1.0;
425 int ie = static_cast<int>(exponent);
426 if (static_cast<double>(ie) == exponent && ie >= -8 && ie <= 8) {
427 double r = 1.0;
428 if (ie > 0) { for (int i = 0; i < ie; ++i) r *= base; return r; }
429 if (ie < 0) { for (int i = 0; i < -ie; ++i) r *= base; return 1.0 / r; }
430 }
431 if (base <= 0.0) return 0.0;
432 return exp_impl_double(exponent * detail::log_natural_<double>(base));
433#endif
434}
F log_natural_(F value) FL_NO_EXCEPT
Definition math.cpp.hpp:296
double exp_impl_double(double value) FL_NO_EXCEPT
Definition math.cpp.hpp:202

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

Referenced by pow().

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