C++ Mathematical Expression Toolkit (ExprTk) release
Loading...
Searching...
No Matches
exprtk::details::numeric::fast_exp< T, N > Struct Template Reference

#include <exprtk.hpp>

Static Public Member Functions

static T result (T v)

Detailed Description

template<typename T, unsigned int N>
struct exprtk::details::numeric::fast_exp< T, N >

Definition at line 1673 of file exprtk.hpp.

Member Function Documentation

◆ result()

template<typename T, unsigned int N>
T exprtk::details::numeric::fast_exp< T, N >::result ( T v)
inlinestatic

Definition at line 1675 of file exprtk.hpp.

1676 {
1677 unsigned int k = N;
1678 T l = T(1);
1679
1680 while (k)
1681 {
1682 if (1 == (k % 2))
1683 {
1684 l *= v;
1685 --k;
1686 }
1687
1688 v *= v;
1689 k /= 2;
1690 }
1691
1692 return l;
1693 }

Referenced by exprtk::details::axn(), exprtk::details::axnb(), norm< T >::norm_impl(), pgo_primer(), exprtk::details::numeric::fast_exp< T, 10 >::result(), exprtk::details::numeric::fast_exp< T, 5 >::result(), exprtk::details::numeric::fast_exp< T, 6 >::result(), exprtk::details::numeric::fast_exp< T, 7 >::result(), exprtk::details::numeric::fast_exp< T, 8 >::result(), and exprtk::details::numeric::fast_exp< T, 9 >::result().

Here is the caller graph for this function:

The documentation for this struct was generated from the following file: