diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp index c20cefc0091..9bdef52c6e4 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp @@ -29,7 +29,6 @@ #include #include -#include #include #include #include @@ -306,15 +305,11 @@ jni::local_ref getPlatformComponentName(const ShadowView& shadowView) { } inline float scale(Float value, Float pointScaleFactor) { - std::feclearexcept(FE_ALL_EXCEPT); float result = value * pointScaleFactor; - if (std::fetestexcept(FE_OVERFLOW) != 0) { - LOG(ERROR) << "Binding::scale - FE_OVERFLOW - value: " << value - << " pointScaleFactor: " << pointScaleFactor - << " result: " << result; - } - if (std::fetestexcept(FE_UNDERFLOW) != 0) { - LOG(ERROR) << "Binding::scale - FE_UNDERFLOW - value: " << value + // Test the product rather than the floating-point status flags, which take a + // library call and a status register access each + if (std::isinf(result) && !std::isinf(value)) { + LOG(ERROR) << "Binding::scale - overflow - value: " << value << " pointScaleFactor: " << pointScaleFactor << " result: " << result; }