| 171 | }; |
| 172 | |
| 173 | bool is_odd_integer(double x) { |
| 174 | using FPBits = fputil::FPBits<double>; |
| 175 | FPBits xbits(x); |
| 176 | uint64_t x_u = xbits.uintval(); |
| 177 | unsigned x_e = static_cast<unsigned>(xbits.get_biased_exponent()); |
| 178 | unsigned lsb = |
| 179 | static_cast<unsigned>(cpp::countr_zero(x_u | FPBits::EXP_MASK)); |
| 180 | constexpr unsigned UNIT_EXPONENT = |
| 181 | static_cast<unsigned>(FPBits::EXP_BIAS + FPBits::FRACTION_LEN); |
| 182 | return (x_e + lsb == UNIT_EXPONENT); |
| 183 | } |
| 184 | |
| 185 | bool is_integer(double x) { |
| 186 | using FPBits = fputil::FPBits<double>; |
no test coverage detected