MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / is_odd_integer

Function is_odd_integer

system/lib/llvm-libc/src/math/generic/powf.cpp:522–531  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

520#endif // LIBC_MATH_HAS_SKIP_ACCURATE_PASS
521
522LIBC_INLINE bool is_odd_integer(float x) {
523 using FPBits = typename fputil::FPBits<float>;
524 uint32_t x_u = cpp::bit_cast<uint32_t>(x);
525 int32_t x_e =
526 static_cast<int32_t>((x_u & FPBits::EXP_MASK) >> FPBits::FRACTION_LEN);
527 int32_t lsb = cpp::countr_zero(x_u | FPBits::EXP_MASK);
528 constexpr int32_t UNIT_EXPONENT =
529 FPBits::EXP_BIAS + static_cast<int32_t>(FPBits::FRACTION_LEN);
530 return (x_e + lsb == UNIT_EXPONENT);
531}
532
533LIBC_INLINE bool is_integer(float x) {
534 using FPBits = typename fputil::FPBits<float>;

Callers 1

LLVM_LIBC_FUNCTIONFunction · 0.70

Calls 1

countr_zeroFunction · 0.85

Tested by

no test coverage detected