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

Method isone

extern/boost/boost/multiprecision/cpp_dec_float.hpp:1462–1483  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1460
1461template <unsigned Digits10, class ExponentType, class Allocator>
1462bool cpp_dec_float<Digits10, ExponentType, Allocator>::isone() const
1463{
1464 // Check if the value of *this is identically 1 or very close to 1.
1465
1466 const bool not_negative_and_is_finite = ((!neg) && (isfinite)());
1467
1468 if (not_negative_and_is_finite)
1469 {
1470 if ((data[0u] == static_cast<std::uint32_t>(1u)) && (exp == static_cast<exponent_type>(0)))
1471 {
1472 const typename array_type::const_iterator it_non_zero = std::find_if(data.begin(), data.end(), data_elem_is_non_zero_predicate);
1473 return (it_non_zero == data.end());
1474 }
1475 else if ((data[0u] == static_cast<std::uint32_t>(cpp_dec_float_elem_mask - 1)) && (exp == static_cast<exponent_type>(-cpp_dec_float_elem_digits10)))
1476 {
1477 const typename array_type::const_iterator it_non_nine = std::find_if(data.begin(), data.end(), data_elem_is_non_nine_predicate);
1478 return (it_non_nine == data.end());
1479 }
1480 }
1481
1482 return false;
1483}
1484
1485template <unsigned Digits10, class ExponentType, class Allocator>
1486bool cpp_dec_float<Digits10, ExponentType, Allocator>::isint() const

Callers 1

rd_stringMethod · 0.80

Calls 3

find_ifFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected