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

Function is_integer

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

Source from the content-addressed store, hash-verified

531}
532
533LIBC_INLINE bool is_integer(float x) {
534 using FPBits = typename fputil::FPBits<float>;
535 uint32_t x_u = cpp::bit_cast<uint32_t>(x);
536 int32_t x_e =
537 static_cast<int32_t>((x_u & FPBits::EXP_MASK) >> FPBits::FRACTION_LEN);
538 int32_t lsb = cpp::countr_zero(x_u | FPBits::EXP_MASK);
539 constexpr int32_t UNIT_EXPONENT =
540 FPBits::EXP_BIAS + static_cast<int32_t>(FPBits::FRACTION_LEN);
541 return (x_e + lsb >= UNIT_EXPONENT);
542}
543
544#ifndef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
545LIBC_INLINE bool larger_exponent(double a, double b) {

Callers 1

LLVM_LIBC_FUNCTIONFunction · 0.70

Calls 1

countr_zeroFunction · 0.85

Tested by

no test coverage detected