Specialisation of the implementation of piranha::math::pow() for piranha::mp_rational.
More...
#include <piranha/mp_rational.hpp>
template<typename T, typename U>
struct piranha::math::pow_impl< T, U, math_rational_pow_enabler< T, U > >
Specialisation of the implementation of piranha::math::pow() for piranha::mp_rational.
This specialisation is activated when one of the arguments is piranha::mp_rational and the other is either piranha::mp_rational or an interoperable type for piranha::mp_rational.
The implementation follows these rules:
- if the base is rational and the exponent an integral type or piranha::mp_integer, then piranha::mp_rational::pow() is used;
- if the non-rational argument is a floating-point type, then the rational argument is converted to that floating-point type and piranha::math::pow() is used;
- if both arguments are rational the result will be rational and the success of the operation depends on the values of the operands;
- if the base is an integral type or piranha::mp_integer and the exponent a rational, the result is computed via the integral–integer specialisation of piranha::math::pow() and the the success of the operation depends on the values of the operands.
Definition at line 1934 of file mp_rational.hpp.
◆ operator()()
template<typename T , typename U >
ret_type piranha::math::pow_impl< T, U, math_rational_pow_enabler< T, U > >::operator() |
( |
const T & |
b, |
|
|
const U & |
e |
|
) |
| const |
|
inline |
Call operator.
- Parameters
-
- Returns
b**e
.
- Exceptions
-
std::invalid_argument | if the result cannot be computed. |
unspecified | any exception thrown by:
|
Definition at line 2017 of file mp_rational.hpp.
The documentation for this struct was generated from the following file: