Exp2
Calculates \(2\) raised to the argument (\(2^{x}\)).
template<FloatingPointType T>
constexpr inline T Exp2( T x ) noexcept;
Example/Test code
using C = Constants<float>;
constexpr auto result1 = Exp2( C::Infinity );
BOOST_CHECK( IsInf( result1 ) );
constexpr auto result2 = Exp2( C::NegativeInfinity );
BOOST_CHECK( result2 == 0 );
constexpr auto result3 = Exp2( C::Zero );
BOOST_CHECK( result3 == 1 );
constexpr auto result4 = Exp2( -C::Zero );
BOOST_CHECK( result4 == 1 );
constexpr auto result5 = Exp2( C::NaN );
BOOST_CHECK( IsNaN( result5 ) );
constexpr auto result6 = Exp2( C::One );
BOOST_CHECK( result6 == 2.f );
constexpr auto result7 = Exp2( C::Two );
BOOST_CHECK( result7 == 4.f );
constexpr auto result8 = Exp2( C::Three );
BOOST_CHECK( result8 == 8.f );
constexpr auto result9 = Exp2( .7f );
BOOST_CHECK( result9 == 1.62450480f );