Files
react-native/packages/react-native/ReactCommon/react/utils/FloatComparison.h
T
Yannick LoriotandFacebook GitHub Bot 7a72037b37 Revert D74291373: Ensure that ShadowNode measure functions respect constraints
Differential Revision:
D74291373

Original commit changeset: 44166f2e4732

Original Phabricator Diff: D74291373

fbshipit-source-id: 54a4dd0af1c020caacebe6f02cb95eba0c95c62f
2025-05-09 01:45:16 -07:00

18 lines
450 B
C++

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
namespace facebook::react {
inline bool floatEquality(float a, float b, float epsilon = 0.005f) {
return (std::isnan(a) && std::isnan(b)) ||
(!std::isnan(a) && !std::isnan(b) && fabs(a - b) < epsilon);
}
} // namespace facebook::react