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

◆ pow_impl_float()

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

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

404 {
405#if FL_MATH_USE_LIBM
406 return ::powf(base, exponent);
407#else
408 if (exponent == 0.0f) return 1.0f;
409 int ie = static_cast<int>(exponent);
410 if (static_cast<float>(ie) == exponent && ie >= -8 && ie <= 8) {
411 float r = 1.0f;
412 if (ie > 0) { for (int i = 0; i < ie; ++i) r *= base; return r; }
413 if (ie < 0) { for (int i = 0; i < -ie; ++i) r *= base; return 1.0f / r; }
414 }
415 if (base <= 0.0f) return 0.0f;
416 return exp_impl_float(exponent * detail::log_natural_<float>(base));
417#endif
418}
F log_natural_(F value) FL_NO_EXCEPT
Definition math.cpp.hpp:296
float exp_impl_float(float value) FL_NO_EXCEPT
Definition math.cpp.hpp:201

References exp_impl_float(), FL_NO_EXCEPT, 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: