/
githubmr
/
facebook-react-native
Обзор
Документация
Войти
/
githubmr
/
facebook-react-native
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-native/ReactCommon/react/utils/FloatComparison.h
23 строки
550 B
nishan (o^▽^o)
- Use CAGradientLayer for linear gradient (#52096)
19 июн 2025, 19:50
19 июн 2025, 19:50
2f3b104
Код
Авторство
О чём код?
/* * 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 #include <cmath> namespace facebook::react { constexpr float kDefaultEpsilon = 0.005f; template <typename T> inline bool floatEquality(T a, T b, T epsilon = static_cast<T>(kDefaultEpsilon)) { return (std::isnan(a) && std::isnan(b)) || (!std::isnan(a) && !std::isnan(b) && std::abs(a - b) < epsilon); } } // namespace facebook::react