MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / isint

Method isint

extern/boost/boost/multiprecision/cpp_dec_float.hpp:1486–1515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1484
1485template <unsigned Digits10, class ExponentType, class Allocator>
1486bool 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
1517template <unsigned Digits10, class ExponentType, class Allocator>
1518void cpp_dec_float<Digits10, ExponentType, Allocator>::extract_parts(double& mantissa, ExponentType& exponent) const

Callers 3

eval_floorFunction · 0.80
eval_ceilFunction · 0.80
eval_truncFunction · 0.80

Calls 3

find_ifFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected