MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / eval_frexp

Function eval_frexp

include/boost/multiprecision/cpp_dec_float.hpp:3435–3459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3433
3434template <unsigned Digits10, class ExponentType, class Allocator>
3435inline void eval_frexp(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& x, ExponentType* e)
3436{
3437 result = x;
3438
3439 if (result.iszero() || (result.isinf)() || (result.isnan)())
3440 {
3441 *e = 0;
3442 return;
3443 }
3444
3445 if (result.isneg())
3446 result.negate();
3447
3448 typename cpp_dec_float<Digits10, ExponentType, Allocator>::exponent_type t = result.order();
3449 BOOST_MP_USING_ABS
3450 if (abs(t) < ((std::numeric_limits<typename cpp_dec_float<Digits10, ExponentType, Allocator>::exponent_type>::max)() / 1000))
3451 {
3452 t *= 1000;
3453 t /= 301;
3454 }
3455 else
3456 {
3457 t /= 301;
3458 t *= 1000;
3459 }
3460
3461 result *= cpp_dec_float<Digits10, ExponentType, Allocator>::pow2(-t);
3462

Callers 1

rd_stringMethod · 0.70

Calls 5

iszeroMethod · 0.80
orderMethod · 0.80
absFunction · 0.50
isnegMethod · 0.45
negateMethod · 0.45

Tested by

no test coverage detected