| 3388 | |
| 3389 | template <unsigned Digits10, class ExponentType, class Allocator> |
| 3390 | inline void eval_frexp(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& x, ExponentType* e) |
| 3391 | { |
| 3392 | result = x; |
| 3393 | |
| 3394 | if (result.iszero() || (result.isinf)() || (result.isnan)()) |
| 3395 | { |
| 3396 | *e = 0; |
| 3397 | return; |
| 3398 | } |
| 3399 | |
| 3400 | if (result.isneg()) |
| 3401 | result.negate(); |
| 3402 | |
| 3403 | typename cpp_dec_float<Digits10, ExponentType, Allocator>::exponent_type t = result.order(); |
| 3404 | BOOST_MP_USING_ABS |
| 3405 | if (abs(t) < ((std::numeric_limits<typename cpp_dec_float<Digits10, ExponentType, Allocator>::exponent_type>::max)() / 1000)) |
| 3406 | { |
| 3407 | t *= 1000; |
| 3408 | t /= 301; |
| 3409 | } |
| 3410 | else |
| 3411 | { |
| 3412 | t /= 301; |
| 3413 | t *= 1000; |
| 3414 | } |
| 3415 | |
| 3416 | result *= cpp_dec_float<Digits10, ExponentType, Allocator>::pow2(-t); |
| 3417 |
no test coverage detected