| 1484 | |
| 1485 | template <unsigned Digits10, class ExponentType, class Allocator> |
| 1486 | bool cpp_dec_float<Digits10, ExponentType, Allocator>::isint() const |
| 1487 | { |
| 1488 | if (fpclass != cpp_dec_float_finite) |
| 1489 | { |
| 1490 | return false; |
| 1491 | } |
| 1492 | |
| 1493 | if (iszero()) |
| 1494 | { |
| 1495 | return true; |
| 1496 | } |
| 1497 | |
| 1498 | if (exp < static_cast<exponent_type>(0)) |
| 1499 | { |
| 1500 | return false; |
| 1501 | } // |*this| < 1. |
| 1502 | |
| 1503 | const typename array_type::size_type offset_decimal_part = static_cast<typename array_type::size_type>(exp / cpp_dec_float_elem_digits10) + 1u; |
| 1504 | |
| 1505 | if (offset_decimal_part >= static_cast<typename array_type::size_type>(cpp_dec_float_elem_number)) |
| 1506 | { |
| 1507 | // The number is too large to resolve the integer part. |
| 1508 | // It considered to be a pure integer. |
| 1509 | return true; |
| 1510 | } |
| 1511 | |
| 1512 | typename array_type::const_iterator it_non_zero = std::find_if(data.begin() + offset_decimal_part, data.end(), data_elem_is_non_zero_predicate); |
| 1513 | |
| 1514 | return (it_non_zero == data.end()); |
| 1515 | } |
| 1516 | |
| 1517 | template <unsigned Digits10, class ExponentType, class Allocator> |
| 1518 | void cpp_dec_float<Digits10, ExponentType, Allocator>::extract_parts(double& mantissa, ExponentType& exponent) const |
no test coverage detected